We need make a audit history for any model in your project
How i do this using " illuminate/database " ?
We need make a audit history for any model in your project
How i do this using " illuminate/database " ?
Hi @abdo.host What are you trying to log exactly for the audit history? All SQL queries?
i mean create audit history for ( create new or edit or delete )
like this : https://github.com/owen-it/laravel-auditing
@abdo.host as you are using Eloquent, you could tap into the model events to queue an insert in model changes? This would probably be the easiest approach as Eloquent Model emit events anyway.
If you are using the DB facade then I would recommend using DB transactions and store the difference.
Obviously there are quite a few ways to achieve this, one I would recommend is a simple event sourcing route.
How i use Eloquent Event with my model can you make for me a sample one ?