feat: initialize Dr-Panel project with patient file number support
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Traits;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
trait HasUserStamps
|
||||
{
|
||||
public static function bootHasUserStamps(): void
|
||||
{
|
||||
static::creating(function ($model) {
|
||||
if (Auth::check()) {
|
||||
$model->created_by = Auth::id();
|
||||
$model->updated_by = Auth::id();
|
||||
}
|
||||
});
|
||||
|
||||
static::updating(function ($model) {
|
||||
if (Auth::check()) {
|
||||
$model->updated_by = Auth::id();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user