diff --git a/app/Models/Franchises.php b/app/Models/Franchises.php index 868451b..7bb723e 100644 --- a/app/Models/Franchises.php +++ b/app/Models/Franchises.php @@ -6,6 +6,7 @@ use App\Models\User; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use App\Models\Scopes\StatusScope; use App\Traits\CreatedUpdatedBy; class Franchises extends Model @@ -50,4 +51,9 @@ class Franchises extends Model get: fn ($value) => User::find($value) ? User::find($value)->name : '', ); } + public static function boot(){ + parent::boot(); + static::addGlobalScope(new StatusScope()); + } + } diff --git a/app/Models/Services.php b/app/Models/Services.php index 98d38d4..bda8619 100644 --- a/app/Models/Services.php +++ b/app/Models/Services.php @@ -2,6 +2,7 @@ namespace App\Models; use App\Models\User; +use App\Models\Scopes\StatusScope; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; @@ -59,4 +60,8 @@ class Services extends Model public function parent(){ return $this->belongsTo(Services::class,'parent_service'); } + public static function boot(){ + parent::boot(); + static::addGlobalScope(new StatusScope()); + } } \ No newline at end of file diff --git a/resources/views/client/topCargo/partials/welcome/news.blade.php b/resources/views/client/topCargo/partials/welcome/news.blade.php index edc63a7..81eca31 100644 --- a/resources/views/client/topCargo/partials/welcome/news.blade.php +++ b/resources/views/client/topCargo/partials/welcome/news.blade.php @@ -9,14 +9,14 @@ @forelse ($news as $item)