This commit is contained in:
tanch0
2024-05-08 14:02:40 +05:45
parent cc991bb0e1
commit 9fa6a5d797
9 changed files with 1681 additions and 97 deletions

View File

@ -1,6 +1,7 @@
<?php
namespace App\Models;
use App\Models\Scopes\StatusScope;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
@ -49,4 +50,9 @@ class News extends Model
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
public static function boot(){
parent::boot();
static::addGlobalScope(new StatusScope());
}
}