feat(event): add per-user date change notices
This commit is contained in:
41
app/Domains/Event/Models/EventDateChangeView.php
Normal file
41
app/Domains/Event/Models/EventDateChangeView.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user