![]()
WARNING You're browsing the documentation for an old version of LARAVEL-DATATABLES. Consider upgrading your project to laravel-datatables 12.0.
DataTables Editor Event Hooks
In addition to Laravel's model events, DataTables Editor offers some pre & post event hooks.
Create Events
Create action has the following event hooks:
creatingevent hook that is fired before creating a new record.createdevent hook that is fired after the record was created.
To use the event hook, just add the methods on your editor class.
public function creating(Model $model, array $data) { return $data;} public function created(Model $model, array $data) { return $data;}
Edit Events
Edit action has the following event hooks:
updatingevent hook that is fired before updating a new record.updatedevent hook that is fired after the record was updated.
To use the event hook, just add the methods on your editor class.
public function updating(Model $model, array $data) { return $data;} public function updated(Model $model, array $data) { return $data;}
Remove Events
Remove action has the following event hooks:
deletingevent hook that is fired before deleting a new record.deletedevent hook that is fired after the record was deleted.
To use the event hook, just add the methods on your editor class.
public function deleting(Model $model, array $data) { return $data;} public function deleted(Model $model, array $data) { return $data;}