public static function table(Table $table): Table
{
return $table
->columns([
//
])
->filters([
//
])
->actions([
Tables\Actions\Action::make('Run')
->label('Run script')
->color('danger')
->size('lg')
->icon('heroicon-o-play')
->requiresConfirmation()
->form([
SpatieMediaLibraryFileUpload::make('excel')
->label('Excel')
->collection('excel')
->preserveFilenames(),
])
->action (function (Request $request) {
$command = new \App\Console\Commands\DeleteData();
$file = $request->file('excel');
return $command->handle($file);
})
])
->bulkActions([
//
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
//
])
->filters([
//
])
->actions([
Tables\Actions\Action::make('Run')
->label('Run script')
->color('danger')
->size('lg')
->icon('heroicon-o-play')
->requiresConfirmation()
->form([
SpatieMediaLibraryFileUpload::make('excel')
->label('Excel')
->collection('excel')
->preserveFilenames(),
])
->action (function (Request $request) {
$command = new \App\Console\Commands\DeleteData();
$file = $request->file('excel');
return $command->handle($file);
})
])
->bulkActions([
//
]);
}