Laravel: performing some task on every insert/update when using Query Builder or Eloquent ORM

后端 未结 5 1324
旧时难觅i
旧时难觅i 2020-12-19 06:32

The Problem

I would like to automatically add created_by and modified_by fields to every insert/update to a database table in Laravel 4,

5条回答
  •  轮回少年
    2020-12-19 06:56

    You can use venturecraft revisionable package because in a table from this package all info that you need is already stored, you just need this package to get them in an elegant way : https://github.com/fico7489/laravel-revisionable-upgrade

提交回复
热议问题