45 lines
868 B
PHP
45 lines
868 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class InterventionNotification extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'intervention_id',
|
|
'channel',
|
|
'destination',
|
|
'payload',
|
|
'status',
|
|
'sent_at'
|
|
];
|
|
|
|
/**
|
|
* The attributes that should be cast.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $casts = [
|
|
'payload' => 'array',
|
|
'sent_at' => 'datetime'
|
|
];
|
|
|
|
/**
|
|
* Get the intervention associated with the notification.
|
|
*/
|
|
public function intervention(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Intervention::class);
|
|
}
|
|
}
|