Files

64 lines
1.2 KiB
PHP
Raw Permalink Normal View History

2026-05-14 11:55:22 +07:00
<?php
namespace Modules\MarketingAddon\App\Models;
use App\Models\Business;
use App\Models\User;
use App\Traits\ImageUrlTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class MessageReport extends Model
{
use HasFactory, ImageUrlTrait;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'title',
'business_id',
'template_id',
'smsgateway_id',
'user_id',
'channel',
'phone',
'message',
'attachment',
'send_at',
'status'
];
public function user()
{
return $this->belongsTo(User::class);
}
public function business()
{
return $this->belongsTo(Business::class);
}
public function smsgateway()
{
return $this->belongsTo(Smsgateway::class, 'smsgateway_id');
}
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'user_id' => 'integer',
'device_id' => 'integer',
'business_id' => 'integer',
'send_attempts' => 'integer',
];
protected $imageFields = ['attachment'];
}