| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php namespace jlourenco\base\Traits; |
||
| 10 | public static function bootCreation() |
||
| 11 | { |
||
| 12 | |||
| 13 | // create a event to happen on updating |
||
| 14 | static::updating(function($table) { |
||
| 15 | $table->updated_by = Sentinel::getUser()->id; |
||
| 16 | }); |
||
| 17 | |||
| 18 | // create a event to happen on deleting |
||
| 19 | static::deleting(function($table) { |
||
| 20 | $table->deleted_by = Sentinel::getUser()->id; |
||
| 21 | }); |
||
| 22 | |||
| 23 | // create a event to happen on saving |
||
| 24 | static::saving(function($table) { |
||
| 25 | $table->created_by = Sentinel::getUser()->id; |
||
| 26 | }); |
||
| 27 | |||
| 28 | } |
||
| 29 | |||
| 30 | } |