44 lines
879 B
PHP
44 lines
879 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
#[Fillable([
|
|
'source',
|
|
'external_id',
|
|
'remote_url',
|
|
'remote_etag',
|
|
'summary',
|
|
'description',
|
|
'location',
|
|
'starts_at',
|
|
'ends_at',
|
|
'attendees',
|
|
'synced_at',
|
|
'deleted_at',
|
|
])]
|
|
class CalendarEvent extends Model
|
|
{
|
|
/**
|
|
* @return HasMany<CalendarReminder, $this>
|
|
*/
|
|
public function reminders(): HasMany
|
|
{
|
|
return $this->hasMany(CalendarReminder::class);
|
|
}
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'starts_at' => 'datetime',
|
|
'ends_at' => 'datetime',
|
|
'attendees' => 'array',
|
|
'synced_at' => 'datetime',
|
|
'deleted_at' => 'datetime',
|
|
];
|
|
}
|
|
}
|