36 lines
683 B
PHP
36 lines
683 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Events\ProjectMosaicStatus;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ProjectMosaic extends Model
|
|
{
|
|
use HasFactory;
|
|
use \App\Traits\HasStatus;
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'path',
|
|
'week',
|
|
'year',
|
|
'status'
|
|
];
|
|
|
|
public function project()
|
|
{
|
|
return $this->belongsTo(Project::class);
|
|
}
|
|
|
|
protected static function booted(): void
|
|
{
|
|
parent::booted();
|
|
static::updated(function (ProjectMosaic $projectMosaic) {
|
|
event(new ProjectMosaicStatus($projectMosaic));
|
|
});
|
|
}
|
|
|
|
}
|