SMS service

This commit is contained in:
Simon Pocrnjič
2025-10-24 21:39:10 +02:00
parent 3a2eed7dda
commit 930ac83604
52 changed files with 3830 additions and 36 deletions
+52
View File
@@ -0,0 +1,52 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class SmsLog extends Model
{
use HasFactory;
protected $table = 'sms_logs';
protected $fillable = [
'uuid',
'profile_id',
'template_id',
'to_number',
'sender',
'message',
'status',
'provider_message_id',
'error_code',
'error_message',
'cost',
'currency',
'meta',
'queued_at',
'sent_at',
'delivered_at',
'failed_at',
];
protected $casts = [
'meta' => 'array',
'queued_at' => 'datetime',
'sent_at' => 'datetime',
'delivered_at' => 'datetime',
'failed_at' => 'datetime',
'cost' => 'decimal:2',
];
public function profile()
{
return $this->belongsTo(SmsProfile::class, 'profile_id');
}
public function template()
{
return $this->belongsTo(SmsTemplate::class, 'template_id');
}
}