how can create custom action?

i want to create new action like edit,delete and after that use it in our tables
3 Replies
pratik
pratik11mo ago
@Nima Hamidpour You can create custom actions using :
use Filament\Tables\Actions\Action;
Action::make('Download')->icon('icon')->action(function(Model $record){
// do something
}),
use Filament\Tables\Actions\Action;
Action::make('Download')->icon('icon')->action(function(Model $record){
// do something
}),
Inside of $table->actions([ //your action here ]) in public static function table(Table $table) of the Resource. Or you can create a new action class extending the base action class and use it on any table you like.
Nima Hamidpour
Nima HamidpourOP11mo ago
thanks i do it and ok but i want to craete action and call anywhere like other pre built actions
awcodes
awcodes11mo ago
Have a look at the prebuilt actions. You can do the same thing.
Want results from more Discord servers?
Add your server