M
M
Mister_Vik7772019-07-05 12:00:03
MySQL
Mister_Vik777, 2019-07-05 12:00:03

How can I save all the changes that happen in the base of the Laravel project?

It is necessary to save all the actions taking place in the database (mysql) of the project (laravel), tell me how best to implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2019-07-05
@Mister_Vik777

app('events')->listen('eloquent.saved: *', ...);
app('events')->listen('eloquent.deleted: *', ...);
app('events')->listen(['eloquent.pivotAttached: *', 'eloquent.pivotDetached: *', 'eloquent.pivotUpdated: *'], ...);

For pivot events, you need to install the fico7489/laravel-pivot package .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question