Files
SkinbaseNova/app/Models/ArtworkFeature.php
klevze 31c87e4977 Move model observers onto attributes and tidy provider bindings.
Register observers with ObservedBy, bind the comment spam classifier, and keep AppServiceProvider focused on application wiring.
2026-09-20 14:49:00 +02:00

44 lines
968 B
PHP

<?php
namespace App\Models;
use App\Observers\ArtworkFeatureObserver;
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
#[ObservedBy([ArtworkFeatureObserver::class])]
class ArtworkFeature extends Model
{
use SoftDeletes;
protected $table = 'artwork_features';
protected $fillable = [
'artwork_id',
'type',
'featured_at',
'expires_at',
'priority',
'label',
'note',
'is_active',
'force_hero',
'created_by',
];
protected $casts = [
'featured_at' => 'datetime',
'expires_at' => 'datetime',
'priority' => 'integer',
'is_active' => 'boolean',
'force_hero' => 'boolean',
];
public function artwork(): BelongsTo
{
return $this->belongsTo(Artwork::class);
}
}