update marketing
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 5m14s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 17s
Build, Push and Deploy / deploy-staging (push) Successful in 41s
Build, Push and Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-05-14 11:55:22 +07:00
parent f80fcc4c1b
commit 05fd3230b8
448 changed files with 17545 additions and 5128 deletions

View File

@@ -0,0 +1,30 @@
<?php
namespace Modules\MarketingAddon\App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class EmailSetting extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'business_id',
'driver',
'host',
'port',
'username',
'password',
'encryption',
'from_name',
'from_address',
];
protected $casts = [
'business_id' => 'integer'
];
}

View File

@@ -0,0 +1,34 @@
<?php
namespace Modules\MarketingAddon\App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class GatewayType extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name',
'inputs',
'driver',
'channel',
'status',
'namespace',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'inputs' => 'json',
];
}

View File

@@ -0,0 +1,63 @@
<?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'];
}

View File

@@ -0,0 +1,32 @@
<?php
namespace Modules\MarketingAddon\App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Smsgateway extends Model
{
use HasFactory;
protected $fillable = [
'name',
'type_id',
'business_id',
'priority',
'status',
'params',
'namespace',
'driver',
'channel',
];
protected $casts = [
'params' => 'json',
];
public function type()
{
return $this->belongsTo(GatewayType::class, 'type_id');
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace Modules\MarketingAddon\App\Models;
use App\Traits\ImageUrlTrait;
use Illuminate\Database\Eloquent\Model;
class Template extends Model
{
use ImageUrlTrait;
protected $fillable = [
'business_id',
'title',
'template',
'type',
'attachment',
'subject',
'variables',
'message',
'status',
];
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'variables' => 'array',
];
protected $imageFields = ['attachment'];
}