Croco
Croco
FFilament
Created by Croco on 4/4/2024 in #❓┊help
Model Policy on page not working
I followed this https://filamentphp.com/docs/3.x/tables/adding-a-table-to-a-livewire-component#adding-the-table to create a table inside a page. Even if I remove the header buttons: ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DeleteBulkAction::make(), ]), ]); it should probably just hide the button, anyway in my case i need to show the checkboxes, so I keep the buttons for now. What i would like you to help me is apply my policy on this table. i have this: protected $policies = [ Order::class => OrderPolicy::class, ]; on OrderPolicy.php: public function delete(User $user, Order $model): bool { logger("delete"); return $user->can('SuperAdmin'); } but this method is never called when record is deleted.
8 replies
FFilament
Created by Croco on 2/28/2024 in #❓┊help
How to show/hide text with delay?
Hey guys, I would like to show a message for a short time then hide it. I'm using Filament v3.
Placeholder::make('')
->content(function(){
return session()->has('otp_error') ? session()->get('otp_error') :
(session()->has('otp_success') ? session()->get('otp_success') : '');
})
->live()
->hiddenLabel(function(){
return !session()->has('otp_error') && !session()->has('otp_success');
}),
Placeholder::make('')
->content(function(){
return session()->has('otp_error') ? session()->get('otp_error') :
(session()->has('otp_success') ? session()->get('otp_success') : '');
})
->live()
->hiddenLabel(function(){
return !session()->has('otp_error') && !session()->has('otp_success');
}),
Thanks
1 replies