mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-08-04 09:19:01 -04:00
29 lines
679 B
PHP
29 lines
679 B
PHP
<?php
|
|
|
|
namespace Modules\Attendance\Entities;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
class Event extends Model
|
|
{
|
|
protected $fillable = ['title','for_whom','location','description','from_date','to_date','image','status','created_by','updated_by'];
|
|
|
|
public function scopeActive($query)
|
|
{
|
|
return $query->where('status',1);
|
|
}
|
|
|
|
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;
|
|
});
|
|
}
|
|
}
|