LH
Change click action on the whole row in list view
As normal, when clicking on a row in the list view, it redirects you to the edit page for the record. How do I change this action to a custom one?
I want to do the action below, when clicking on a record row instead of redirecting to edit page.
Tables\Actions\Action::make('show_location')
->action(function ($record){
$record->delete();
})
->icon('carbon-location')
->requiresConfirmation()
->modalHeading('Delete Inactive Product')
->modalDescription('Are you sure you'd like to delete this inactive product? This cannot be undone.')
->modalSubmitActionLabel('Yes, delete it')
->modalContent(fn ($record): View => view('components.location-shelf', ['record' => $record])),
2 replies
Action submits twice error
I'm currently trying to import products from a xlsx file by creating action that has a form with FileUpload to take the xlsx file.
In the action(function ($data)), I get the path to the file uploaded via $data, and then I use the laravel excel Excel::import to extract the data from the xlsx file. But somehow the process gets closed and the action runs again without any data - breaking the first process with the xlsx file causing the process not to be imported.
For me, it seems like there is a timeout on actions, but is there a way to override or increase the timeout?
3 replies