Publication initiale de RelaisSMS : documentation et sources nettoyees
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
#[Fillable([
|
||||
'calendar_event_id',
|
||||
'sms_campaign_id',
|
||||
'reminder_key',
|
||||
'action',
|
||||
'trigger_minutes',
|
||||
'remind_at',
|
||||
'status',
|
||||
'last_error',
|
||||
'sent_at',
|
||||
])]
|
||||
class CalendarReminder extends Model
|
||||
{
|
||||
/**
|
||||
* @return BelongsTo<CalendarEvent, $this>
|
||||
*/
|
||||
public function event(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(CalendarEvent::class, 'calendar_event_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsTo<SmsCampaign, $this>
|
||||
*/
|
||||
public function smsCampaign(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(SmsCampaign::class);
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'remind_at' => 'datetime',
|
||||
'sent_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user