update marketing
All checks were successful
All checks were successful
This commit is contained in:
30
Modules/MarketingAddon/App/Models/EmailSetting.php
Normal file
30
Modules/MarketingAddon/App/Models/EmailSetting.php
Normal 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'
|
||||
];
|
||||
}
|
||||
34
Modules/MarketingAddon/App/Models/GatewayType.php
Normal file
34
Modules/MarketingAddon/App/Models/GatewayType.php
Normal 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',
|
||||
];
|
||||
}
|
||||
63
Modules/MarketingAddon/App/Models/MessageReport.php
Normal file
63
Modules/MarketingAddon/App/Models/MessageReport.php
Normal 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'];
|
||||
|
||||
}
|
||||
32
Modules/MarketingAddon/App/Models/Smsgateway.php
Normal file
32
Modules/MarketingAddon/App/Models/Smsgateway.php
Normal 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');
|
||||
}
|
||||
}
|
||||
34
Modules/MarketingAddon/App/Models/Template.php
Normal file
34
Modules/MarketingAddon/App/Models/Template.php
Normal 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'];
|
||||
}
|
||||
Reference in New Issue
Block a user