Publication initiale de RelaisSMS : documentation et sources nettoyees
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
#[Fillable([
|
||||
'sms_campaign_id',
|
||||
'contact_id',
|
||||
'contact_phone_number_id',
|
||||
'contact_name',
|
||||
'number',
|
||||
'status',
|
||||
'provider_message_id',
|
||||
'provider_response',
|
||||
'error_message',
|
||||
'sent_at',
|
||||
])]
|
||||
class SmsDelivery extends Model
|
||||
{
|
||||
/**
|
||||
* @return BelongsTo<SmsCampaign, $this>
|
||||
*/
|
||||
public function campaign(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(SmsCampaign::class, 'sms_campaign_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsTo<Contact, $this>
|
||||
*/
|
||||
public function contact(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Contact::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsTo<ContactPhoneNumber, $this>
|
||||
*/
|
||||
public function phoneNumber(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(ContactPhoneNumber::class, 'contact_phone_number_id');
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'provider_response' => 'array',
|
||||
'sent_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user