42 lines
996 B
PHP
42 lines
996 B
PHP
<?php
|
|
|
|
namespace App\Domains\Event\Models;
|
|
|
|
use App\Domains\Auth\Models\User;
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
#[Fillable([
|
|
'user_id',
|
|
'event_date_change_id',
|
|
'display_count',
|
|
'last_displayed_at',
|
|
])]
|
|
class EventDateChangeView extends Model
|
|
{
|
|
protected $table = 'user_event_date_change_views';
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'user_id' => 'integer',
|
|
'event_date_change_id' => 'integer',
|
|
'display_count' => 'integer',
|
|
'last_displayed_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
/** @return BelongsTo<User, $this> */
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
/** @return BelongsTo<EventDateChange, $this> */
|
|
public function eventDateChange(): BelongsTo
|
|
{
|
|
return $this->belongsTo(EventDateChange::class);
|
|
}
|
|
}
|