gremki
gremki
FFilament
Created by gremki on 7/19/2024 in #❓┊help
Pivot cast in relation manager
Does anyone have any idea? Is it a bug or I'm misusing the component?
3 replies
FFilament
Created by gremki on 6/24/2024 in #❓┊help
How to get page reference from resource
Thanks a lot! That pointed me in the right direction. Also, there is even a simpler way, there is a getLivewire() available on table and form components:
$table->getLivewire()->parent_id
$table->getLivewire()->parent_id
6 replies
FFilament
Created by Nick Ruddra on 6/23/2024 in #❓┊help
Can Anyone help me with policy ?
Glad I could help!
7 replies
FFilament
Created by Nick Ruddra on 6/23/2024 in #❓┊help
Can Anyone help me with policy ?
By default policy in Filament is actually the policy rule set by Laravel: https://laravel.com/docs/11.x/authorization#registering-policies To customize this, go to your PanelProvider boot() method and add something like this:
Gate::guessPolicyNamesUsing(function (string $modelClass){
// follow the same namespace as the model
$targetPolicy = str_replace('Models', 'Policies', $modelClass) . 'Policy';

return class_exists($targetPolicy) ? $targetPolicy : null;
});
Gate::guessPolicyNamesUsing(function (string $modelClass){
// follow the same namespace as the model
$targetPolicy = str_replace('Models', 'Policies', $modelClass) . 'Policy';

return class_exists($targetPolicy) ? $targetPolicy : null;
});
This will follow same policy structure same as in model.
7 replies
FFilament
Created by gremki on 6/19/2024 in #❓┊help
Extra route parameter for a resource
Nope, already did that...
13 replies
FFilament
Created by gremki on 6/19/2024 in #❓┊help
Extra route parameter for a resource
probably something related to lifecycle, if I make the parameter optional it works, but it's a required one...
13 replies
FFilament
Created by gremki on 6/19/2024 in #❓┊help
Extra route parameter for a resource
it's filament.adminhub.resources.geography.sub-destinations.index and the result is: GET|HEAD adminhub/geography/sub-destinations/{parent} ...................... filament.adminhub.resources.geography.sub-destinations.index › App\Filament\Admin\Resources\Geography\SubDestinationResource\Pages\ListSubDestinations
13 replies
FFilament
Created by gremki on 6/19/2024 in #❓┊help
Extra route parameter for a resource
I tried to get the parameter from route but, in getPages() method, request()->route() is null. Nobody has any idea?
13 replies
FFilament
Created by blink on 5/11/2024 in #❓┊help
File (image) upload preview as grid
Yes, it's true it's not specified in the docs but it works. Just do
->panelLayout('grid')
->panelLayout('grid')
6 replies
FFilament
Created by gremki on 5/11/2024 in #❓┊help
Error when I overwrite a view
Thank you!
5 replies