Ayman Alhattami
Ayman Alhattami
FFilament
Created by Ayman Alhattami on 7/9/2024 in #❓┊help
Get field data of parent repeater from nested repeater
I have two nested repeaters and from the second repeater I want to get the data of parent repeater The way in the documentation does not work with me to get parent repeater data https://filamentphp.com/docs/3.x/forms/fields/repeater#using-get-to-access-parent-field-values
Forms\Components\Select::make('currency_id')
->translateLabel()
->required()
->relationship('currency', 'name')
->searchable()
->preload()
->live(),
Forms\Components\Repeater::make('journalEntries')
->relationship('journalEntries')
->schema([
Forms\Components\Select::make('chart_of_account_id')
->relationship(name: 'chartOfAccount', titleAttribute: 'name', modifyQueryUsing: function ($query) {
return $query->kids();
}),
Forms\Components\TextInput::make('debit')->live(),
Forms\Components\TextInput::make('credit')->live(),
Forms\Components\TextInput::make('description'),
Forms\Components\Repeater::make('costCenterJournalEntries')
->relationship('costCenterJournalEntries')
->schema([
Forms\Components\Select::make('cost_center_id')
->relationship(name: 'costCenter', titleAttribute: 'name', modifyQueryUsing: function ($query) {
return $query->kids();
}),
Forms\Components\TextInput::make('amount'),
])->live()
])->live()
Forms\Components\Select::make('currency_id')
->translateLabel()
->required()
->relationship('currency', 'name')
->searchable()
->preload()
->live(),
Forms\Components\Repeater::make('journalEntries')
->relationship('journalEntries')
->schema([
Forms\Components\Select::make('chart_of_account_id')
->relationship(name: 'chartOfAccount', titleAttribute: 'name', modifyQueryUsing: function ($query) {
return $query->kids();
}),
Forms\Components\TextInput::make('debit')->live(),
Forms\Components\TextInput::make('credit')->live(),
Forms\Components\TextInput::make('description'),
Forms\Components\Repeater::make('costCenterJournalEntries')
->relationship('costCenterJournalEntries')
->schema([
Forms\Components\Select::make('cost_center_id')
->relationship(name: 'costCenter', titleAttribute: 'name', modifyQueryUsing: function ($query) {
return $query->kids();
}),
Forms\Components\TextInput::make('amount'),
])->live()
])->live()
2 replies
FFilament
Created by Ayman Alhattami on 3/14/2024 in #❓┊help
JavaScript event for table row "<tr>"
Is it possible to add contextmenu JavaScript event to table row?
4 replies
FFilament
Created by Ayman Alhattami on 11/29/2023 in #❓┊help
Dynamic Repeater
I need to implement product variants as in this video https://www.youtube.com/watch?v=njdHCpildhE Is it possible with Repeater? I did not find any helpful information in repeater page documentation on how to create dynamic repeater with different default value for each repeater form field. I tried to override some methods on Repeater, but It does not work. Also I used
default()
default()
and
childComponents
childComponents
and nothing worked with me.
13 replies
FFilament
Created by Ayman Alhattami on 11/3/2023 in #❓┊help
How can I get the uploaded file before saving data
Is there a way to get the uploaded file before saving data to the database in CreateCustomer class that extends CreateRecord
class CreateCustomer extends CreateRecord
{
protected static string $resource = CustomerResource::class;
}
class CreateCustomer extends CreateRecord
{
protected static string $resource = CustomerResource::class;
}
this is the form in resource class
Select::make('group_id')->translateLabel()
->options(Group::pluck('name', 'id'))
->searchable()
->hiddenOn(['edit'])
->required(),
TextInput::make('phone')->translateLabel()
->required()
->maxLength(191),
TextInput::make('email')->translateLabel()
->email()
->maxLength(191),
FileUpload::make('identity'),
Select::make('group_id')->translateLabel()
->options(Group::pluck('name', 'id'))
->searchable()
->hiddenOn(['edit'])
->required(),
TextInput::make('phone')->translateLabel()
->required()
->maxLength(191),
TextInput::make('email')->translateLabel()
->email()
->maxLength(191),
FileUpload::make('identity'),
8 replies
FFilament
Created by Ayman Alhattami on 10/15/2023 in #❓┊help
I need to get table query in header action or bulk action based on table filter
How can I get resource table query based on table filters in bulk action or in header action?
8 replies
FFilament
Created by Ayman Alhattami on 9/3/2023 in #❓┊help
How can I align the 'save changes' action button to the right side?
No description
4 replies
FFilament
Created by Ayman Alhattami on 4/13/2023 in #❓┊help
Can I use Form layouts like FieldSet with table filter ?
Can I use Form layouts like FieldSet with table filter ?
17 replies
FFilament
Created by Ayman Alhattami on 3/26/2023 in #❓┊help
Current record in custom page ?
How can I get the current record in custom page ?
4 replies
FFilament
Created by Ayman Alhattami on 3/24/2023 in #❓┊help
Filament Modal
How can I change the position of madal to be at the top of page instead of the middle ?
3 replies