jmrufo
Permanent filters during user session
Hello
I'm building an application in which I would like the filters applied by the logged in user to a table to be maintained during the logged in user session, so that the filters are not deleted when the page is reloaded.
I've been looking for information and examples but I haven't found anything.
Can anyone help me?
Thanks. Best regards.
5 replies
Problem editing filtered record
Hi guys. I hope someone can help me.
I have a table with data that is filtered before loading based on the role of the logged in user. In this way, the user only sees the records that he/she must manage. The query I use is the following:
public static function getEloquentQuery(): Builder
{
if (Auth::user()->hasRole('panel_user')) {
return parent::getEloquentQuery()->where('modality', 'TF');
} elseif (Auth::user()->hasRole('panel_user_presencial')) {
return parent::getEloquentQuery()->where('modality', '=','P')->Orwhere('modality', '=', 'M')->Orwhere('modality', '=', 'AV');
} else {
return parent::getEloquentQuery();
}
} Los datos obtenidos son correctos para cada usuario, el problema ocurre cuando se intenta editar un registro, siempre edita el primero de la lista independientemente del que pulse. Why does this happen? How can I solve it? Thanks in advance
} Los datos obtenidos son correctos para cada usuario, el problema ocurre cuando se intenta editar un registro, siempre edita el primero de la lista independientemente del que pulse. Why does this happen? How can I solve it? Thanks in advance
8 replies
Error in Full Calendar installation process
Hi guys.
I'm trying to install Full Calendar and I get the following error when I try.
λ composer require saade/filament-fullcalendar:^3.0
The "3.0" constraint for "saade/filament-fullcalendar" appears too strict and will likely not match what you want. See https://getcomposer.org/constraints
./composer.json has been updated
Running composer update saade/filament-fullcalendar
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires saade/filament-fullcalendar 3.0 -> satisfiable by saade/filament-fullcalendar[v3.0.0].
- saade/filament-fullcalendar v3.0.0 requires illuminate/contracts ^9.0|^10.0 -> found illuminate/contracts[v9.0.0, ..., v9.52.16, v10.0.0, ..., v10.48.22] but these were not loaded, likely because it conflicts with another require.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
I don't know exactly how to fix it, I've updated to the latest version of Laravel and Filament but I still have the problem.
Can anyone tell me how to fix it?
Regards.
6 replies
Several recordClasses
Hi guys.
I would like to apply several css styles according to the added rules but I can't find a way to be able to do more than one check with recordClasses.
If I create this rule it works perfectly:
->recordClasses(
fn (Programming $record) => $record->canceled == 1 ? 'my-line-bg-canceled' : null
)
But I would also like to add this other one that checks another property:
->recordClasses(
fn (Programming $record) => $record->incident == 1 ? 'my-line-bg-incident' : null
);
Can someone tell me if this is possible in filament.
Thanks to all
6 replies
Autofill TextInput based on Select value in FilamentPhp
I am developing a project in FilamentPhp and I have encountered the following problem that I do not know how to solve.
I would like to be able to auto-complete a TextInput dynamically depending on the value I select in a Select, that is, the logic would be the following:
I select an option from the Select
I make a query with the selected option from the Select to retrieve all the information from the model
I auto-fill the TextInput with the retrieved information.
Can anyone help me with this?
Regards
5 replies