Files
wticreatorstudio/Modules/Attendance/Entities/ToDo.php
T
2024-02-12 22:54:20 -05:00

24 lines
491 B
PHP

<?php
namespace Modules\Attendance\Entities;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Auth;
class ToDo extends Model
{
protected $fillable = ['status','title'];
public static function boot()
{
parent::boot();
static::created(function ($model) {
$model->created_by = Auth::id() ?? null;
});
static::updating(function ($model) {
$model->updated_by = Auth::id() ?? null;
});
}
}