skashizadeh
skashizadeh
FFilament
Created by Ashk on 7/30/2024 in #❓┊help
Accessing a form component from another
it looks nice
24 replies
FFilament
Created by Ashk on 7/30/2024 in #❓┊help
Accessing a form component from another
TRY THIS [ Forms\Components\Select::make('type_event_id') ->label(('labels.type')) ->required() ->reactive() ->prefixIcon(fn (?string $state) => !is_null($state) ? 'heroicon-m-stop' : null ) ->afterStateUpdated(function ($state, $set, $get) { // Trigger a re-render $set('title', $get('title') . ''); $set('titlePlaceholder', "$state"); }) ->prefixIconColor(function (Forms\Components\Select $component) { $color = $component->getSelectedRecord()?->background_color; return !is_null($color) ? Color::hex($color) : null; }) ->relationship( 'typeEvent', 'name' ) ->createOptionForm(TypeEventResource::formSchema()) ->createOptionAction( fn (Forms\Components\Actions\Action $action) => $action ->slideOver() ->modalWidth('xl'), ), Forms\Components\TextInput::make('title') ->label(('labels.title')) ->placeholder(fn ($get) => $get('titlePlaceholder') ?? 'Default placeholder') ->reactive(), ]
24 replies
FFilament
Created by varovas on 7/30/2024 in #❓┊help
Eager loaded relationships filter
can you show the query from debugger?
14 replies
FFilament
Created by Ashk on 7/30/2024 in #❓┊help
Accessing a form component from another
you want to get selected item and put its value as placeholder inside title?
24 replies
FFilament
Created by Ashk on 7/30/2024 in #❓┊help
Accessing a form component from another
never needed, always used get / set to do the work
24 replies
FFilament
Created by Ashk on 7/30/2024 in #❓┊help
Accessing a form component from another
:/ change reactive to live. i did not see reactive anywhere
24 replies
FFilament
Created by Ashk on 7/30/2024 in #❓┊help
Accessing a form component from another
what version of filament do you use?
24 replies
FFilament
Created by Ashk on 7/30/2024 in #❓┊help
Accessing a form component from another
may you put your actual code here?
24 replies
FFilament
Created by Ashk on 7/30/2024 in #❓┊help
Accessing a form component from another
you must use ->live() on field so after changing that field the screen reload with new state
24 replies
FFilament
Created by Pscl on 7/30/2024 in #❓┊help
How to use a Repeater with relation ship in an actions form?
No description
4 replies
FFilament
Created by varovas on 7/30/2024 in #❓┊help
Eager loaded relationships filter
you might need a left join look at this return $query->withCount(['posts' => function ($q) use ($startDate, $endDate) { $q->whereBetween('created_at', [$startDate, $endDate]); }]);
14 replies
FFilament
Created by varovas on 7/30/2024 in #❓┊help
Eager loaded relationships filter
this might help ``` ->filters([ Filter::make('posts_between_dates') ->form([ DatePicker::make('start_date') ->label('Start Date') ->required(), DatePicker::make('end_date') ->label('End Date') ->required(), ]) ->query(function ($query, array $data) { $startDate = Carbon::parse($data['start_date'])->startOfDay(); $endDate = Carbon::parse($data['end_date'])->endOfDay(); return $query->whereHas('posts', function ($q) use ($startDate, $endDate) { $q->whereBetween('created_at', [$startDate, $endDate]); }); }), ]);
14 replies
FFilament
Created by TranceCode on 7/30/2024 in #❓┊help
DatePicker type moth not working in Firefox and Safari
as you can see in here https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/month#browser_compatibility firefox / safari does not support type month. so i think you can use jquery or use two different select field ( one for month and the other for year )
3 replies