varovas
varovas
FFilament
Created by varovas on 3/6/2025 in #❓┊help
Filament preloaded css and my tailwind vite compiled css conflict.
Hi, I have a strange issue. When I run "npm run build", my css are generated and it kind of overrides filaments base theme css. For example: Header div class list: "fi-header flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between". It looks very good, but .flex-col from my generated tailwind css file overrides "sm:flex-row" class. But, if I run npm run dev. Then every thing looks as it supposed to be. Does anyone knows what could cause the issue? What is also strange, that I do not have the same issue on my local environment.
2 replies
FFilament
Created by varovas on 12/31/2024 in #❓┊help
Spatie translatable plugin issue or not
How to pass default locales from a database? Although, code below works, but it breaks the application when you try to run for example php artisan migrate on a fresh database.
->plugin(
SpatieLaravelTranslatablePlugin::make()
->defaultLocales(Language::all()->pluck('code')->toArray())
)
->plugin(
SpatieLaravelTranslatablePlugin::make()
->defaultLocales(Language::all()->pluck('code')->toArray())
)
2 replies
FFilament
Created by varovas on 9/3/2024 in #❓┊help
file upload error
No description
16 replies
FFilament
Created by varovas on 8/22/2024 in #❓┊help
Do something with record after save
Hi, somehow I did not find a solution for doing something with a record after it was created/updated. Use case: I want to place a checkbox to a resource form. Then when record was created or updated, I want to check if that checkbox was checked and if it was, I want to create a job operation. Example:
public function afterSaveHook(Model $model, array $data)
{
if (isset($data['is_completed']) {
SendCompletedNotification::dispatch($model);
}
}
public function afterSaveHook(Model $model, array $data)
{
if (isset($data['is_completed']) {
SendCompletedNotification::dispatch($model);
}
}
4 replies
FFilament
Created by varovas on 7/30/2024 in #❓┊help
Eager loaded relationships filter
Hi, does anyone know how make a filter that would filter record's relationships. What I basically need is I want to display all users, but be able to filter how many posts have they posted between 2 dates. Below you can see the code I tries, but somehow it does not work. Or maybe it is not possible that way?
Filter::make('start')
->form([
DatePicker::make('start_date')->label('Start Date'),
])
->query(function ($query, array $data) {
$startDate = Carbon::parse($data['start_date'])->format('Y-m-d');
return $query->with('posts', function ($q) use ($startDate) {
$q->where('date', '>=', $startDate);
});
}),
Filter::make('start')
->form([
DatePicker::make('start_date')->label('Start Date'),
])
->query(function ($query, array $data) {
$startDate = Carbon::parse($data['start_date'])->format('Y-m-d');
return $query->with('posts', function ($q) use ($startDate) {
$q->where('date', '>=', $startDate);
});
}),
14 replies