[WIP] Import Plans
This commit is contained in:
21
app/Traits/Blameable.php
Normal file
21
app/Traits/Blameable.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Traits;
|
||||
|
||||
trait Blameable {
|
||||
|
||||
public static function bootBlameable() {
|
||||
static::creating(function ($model) {
|
||||
$model->created_by = auth()->id() ?? NULL;
|
||||
});
|
||||
|
||||
static::updating(function ($model) {
|
||||
$model->updated_by = auth()->id() ?? NULL;
|
||||
});
|
||||
|
||||
static::deleting((function ($model) {
|
||||
$model->deleted_by = auth()->id() ?? NULL;
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user