ldc-supportweb/app/Models/Notice.php
2026-04-30 14:48:24 +02:00

99 lines
2.6 KiB
PHP

<?php
namespace App\Models;
use App\Enums\NoticeTypeEnum;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Uwil\LaravelActivityLogs\Traits\HasActivityLog;
use Uwil\LaravelBackend\Traits\Models\HasCache;
use Uwil\LaravelBackend\Traits\Models\HasModelNaming;
use Uwil\LaravelBackend\Traits\Models\HasUwilImages;
use Uwil\LaravelI18n\Traits\Models\HasTranslations;
/**
* @property integer $id Id of the notice.
* @property string $title Title of the notice.
* @property string $message Message of the notice.
* @property integer $type Type of the notice.
* @property-read \Illuminate\Support\Carbon $created_at Date the notice password was created.
* @property-read \Illuminate\Support\Carbon $updated_at Date the notice password was updated.
* @property-read \Illuminate\Support\Carbon $deleted_at Date the notice password was deleted.
*/
class Notice extends Model
{
use HasActivityLog;
use HasCache;
use HasFactory;
use HasModelNaming;
use HasTranslations;
use HasUwilImages;
use SoftDeletes;
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'title',
'message',
'type',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'type' => NoticeTypeEnum::class,
];
/**
* The translatable columns.
*
* @var list<string>
*/
public $translatable = [
'title',
'message',
];
/**
* Relations should be included in the cache.
*
* @var list<string>
*/
protected static $cacheRelations = [
// TODO: Relations here.
];
/**
* Perform any actions required after the model boots.
*
* @return void
*/
protected static function booted(): void
{
static::creating(function (self $model) {
// TODO: Methods here.
});
static::updating(function (self $model) {
// TODO: Methods here.
});
static::updated(function (self $model) {
// TODO: Methods here.
});
static::restoring(function (self $model) {
// TODO: Methods here.
});
static::deleted(function (self $model) {
// TODO: Methods here.
});
static::forceDeleted(function (self $model) {
// TODO: Methods here.
});
}
}