Naren
Naren
FFilament
Created by Naren on 11/3/2023 in #❓┊help
Passing and Calling an Action from a Parent Livewire Component to a Child Component
I have a Livewire parent component with a delete action defined as $this->deleteAction. I want to pass this action to a child component and call it from the child component's Blade file. Is it possible <div> @foreach ($posts as $post) <h2>{{ $post->title }}</h2>
@endforeach {{ ($this->deleteAction) }} <livewire:child-component /> <x-filament-actions::modals /> </div> I tried using {{ $parent->deleteAction }} from child component blade.. but not working. is there any way i can access from child component blade view.
2 replies
FFilament
Created by Naren on 7/2/2023 in #❓┊help
Hidden attribute not working as expected for Sections in Filament Form
Hello, I'm currently using the Filament package for a project and I've encountered an issue. I am trying to hide a Forms\Components\Section based on the value of a Forms\Components\Select input field using the hidden method. It appears that the hidden method works correctly when used with Forms\Components\DatePicker, but it does not behave as expected when applied to Forms\Components\Section. Is this a known issue, or am I perhaps using it incorrectly? Here is a snippet of the code I'm working with:
Forms\Components\Section::make('Contract')
->relationship('contract')
->hidden(function (Closure $get) {
return $get('employee_type_id') !== 3;
})
->schema([
Forms\Components\DatePicker::make('start_date'),
Forms\Components\DatePicker::make('end_date'),
Forms\Components\TextArea::make('terms')->columnSpan('full'),
])
->columns(2),
Forms\Components\Section::make('Contract')
->relationship('contract')
->hidden(function (Closure $get) {
return $get('employee_type_id') !== 3;
})
->schema([
Forms\Components\DatePicker::make('start_date'),
Forms\Components\DatePicker::make('end_date'),
Forms\Components\TextArea::make('terms')->columnSpan('full'),
])
->columns(2),
In this case, the Contract section should be hidden unless the employee_type_id is 3, but it seems to always be hidden, regardless of the employee_type_id value. Any assistance would be greatly appreciated. Thank you.
16 replies
FFilament
Created by Naren on 6/20/2023 in #❓┊help
Updating parent form state from a child component in Filament's Repeater
10 replies
FFilament
Created by Naren on 5/31/2023 in #❓┊help
Navigation
3 replies