update marketing
All checks were successful
All checks were successful
This commit is contained in:
0
Modules/MarketingAddon/Database/Seeders/.gitkeep
Normal file
0
Modules/MarketingAddon/Database/Seeders/.gitkeep
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MarketingAddon\Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Modules\MarketingAddon\App\Models\GatewayType;
|
||||
|
||||
class GatewayTypeSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$gateway_types = array(
|
||||
array('name' => 'AWS SNS', 'inputs' => '{"names":["key","secret","region","from","type"],"labels":["Api Key","Secret Key","Region","Sender ID","Type"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'sns', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'Textlocal', 'inputs' => '{"names":["url","username","hash","from"],"labels":["Api URL","User Name","Hash","Sender Name"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'textlocal', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'Twilio', 'inputs' => '{"names":["sid","token","from"],"labels":["Api SID","Api Token","Default Number"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'twilio', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'Clockwork', 'inputs' => '{"names":["key"],"labels":["Api Key"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'clockwork', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'LINK Mobility', 'inputs' => '{"names":["url","username","password","from"],"labels":["Api URL","User Name","Password","Sender name"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'linkmobility', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'Melipayamak', 'inputs' => '{"names":["username","password","from","flash"],"labels":["User Name","Password","Default Number","Flash"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'melipayamak', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'Melipayamakpattern', 'inputs' => '{"names":["username","password"],"labels":["User Name","Password"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'melipayamakpattern', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'Kavenegar', 'inputs' => '{"names":["apiKey","from"],"labels":["Api Key","Default Number"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'kavenegar', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'Smsir', 'inputs' => '{"names":["url","apiKey","secretKey","from"],"labels":["Api URL","Api Key","Secret Key","Default Number"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'smsir', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'Tsms', 'inputs' => '{"names":["url","username","password","from"],"labels":["Api URL","User Name","Password","Default Number"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'tsms', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'Farazsms', 'inputs' => '{"names":["url","username","password","from"],"labels":["Api URL","User Name","Password","Default Number"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'farazsms', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'Farazsmspattern', 'inputs' => '{"names":["url","username","password","from"],"labels":["Api URL","User Name","Password","Default Number"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'farazsmspattern', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'SMS Gateway Me', 'inputs' => '{"names":["apiToken","from"],"labels":["Api Token","Default Device ID"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'smsgatewayme', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'SmsGateWay24', 'inputs' => '{"names":["url","token","deviceid","from"],"labels":["Api URL","Api Token","Device ID","Device SIM Slot"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'smsgateway24', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'Ghasedak', 'inputs' => '{"names":["url","apiKey","from"],"labels":["Api URL","Api Key","Default Number"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'ghasedak', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'Sms77', 'inputs' => '{"names":["apiKey","flash","from"],"labels":["Api Key","Flash","Sender name"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'sms77', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'SabaPayamak', 'inputs' => '{"names":["url","username","password","from","token_valid_day"],"labels":["Api URL","User Name","Password","Default Number","Token Validity day"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'sabapayamak', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'LSim', 'inputs' => '{"names":["username","password","from"],"labels":["User Name","Password","Sender ID"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'lsim', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'Rahyabcp', 'inputs' => '{"names":["url","username","password","from","flash"],"labels":["Api URL","User Name","Password","Default Number","Flash"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'rahyabcp', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'Rahyabir', 'inputs' => '{"names":["url","username","password","company","from","token_valid_day"],"labels":["Api URL","User Name","Password","Company Name","Default Number","Token Validity Day"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'rahyabir', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'D7networks', 'inputs' => '{"names":["url","username","password","originator","report_url","token_valid_day"],"labels":["Api URL","User Name","Password","Originator","Report Url","Token Validity Day"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'd7networks', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'Hamyarsms', 'inputs' => '{"names":["url","username","password","from","flash"],"labels":["Api URL","User Name","Password","Default Number","Flash"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'hamyarsms', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'SMSApi', 'inputs' => '{"names":["url","username","password","from","cc"],"labels":["Api URL","User Name","Password","Default Number","Country Code"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\TzskSms', 'driver' => 'smsapi', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'Route Mobile', 'inputs' => '{"names":["api_url","api_method","username","password","type","dlr","number_key","destination","source","message_key"],"labels":["Api URL","Api Method","User Name","Password","Type","DLR","Number Key","Destination","Source","Message Key"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\RouteMobile', 'driver' => 'smsapi', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'HaDavar', 'inputs' => '{"names":["api_url","api_method","username","token","sender","number_key","message_key"],"labels":["Api URL","Api Method","User Name","Token","Sender","Number Key","Message Key"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\HaDavar', 'driver' => '', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'Acnoo Sms', 'inputs' => '{"names":["client_id","client_secret","gateway_id"],"labels":["Client Id","Client Secret","Gateway Id"]}', 'namespace' => 'Modules\MarketingAddon\App\SmsGateways\AcnooSms', 'driver' => 'acnoosms', 'channel' => 'sms', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
|
||||
// whatsapp
|
||||
array('name' => 'AiSensy', 'inputs' => '{"names":["api_key"],"labels":["Api Key"]}', 'namespace' => 'Modules\MarketingAddon\App\WhatsappGateways\AiSensy', 'driver' => 'aisensy', 'channel' => 'whatsapp', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
array('name' => 'WhatsApp Cloud API', 'inputs' => '{"names":["access_token","phone_number_id","api_version","language_code"],"labels":["Access Token","Phone Number ID","API Version","Template Language Code (en_US)"]}', 'namespace' => 'Modules\MarketingAddon\App\WhatsappGateways\WhatsAppCloudApi', 'driver' => 'whatsapp-cloud-api', 'channel' => 'whatsapp', 'status' => 1, 'created_at' => now(), 'updated_at' => now()),
|
||||
);
|
||||
|
||||
GatewayType::insert($gateway_types);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MarketingAddon\Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class MarketingAddonDatabaseSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$this->call([
|
||||
GatewayTypeSeeder::class,
|
||||
TemplateSeeder::class,
|
||||
OptionSeeder::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
25
Modules/MarketingAddon/Database/Seeders/OptionSeeder.php
Normal file
25
Modules/MarketingAddon/Database/Seeders/OptionSeeder.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MarketingAddon\Database\Seeders;
|
||||
|
||||
use App\Models\Option;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
|
||||
class OptionSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$options = array(
|
||||
array('key' => 'notification_settings_1', 'value' => '{"new_sale":{"sms":{"enabled":1},"whatsapp":{"enabled":0},"email":{"enabled":0}},"payment_received":{"sms":{"enabled":0},"whatsapp":{"enabled":0},"email":{"enabled":1}},"payment_paid":{"sms":{"enabled":1},"whatsapp":{"enabled":0},"email":{"enabled":0}},"purchase":{"sms":{"enabled":1},"whatsapp":{"enabled":1},"email":{"enabled":1}},"payment_reminder":{"sms":{"enabled":0},"whatsapp":{"enabled":1},"email":{"enabled":0}}}', 'status' => '1', 'created_at' => '2026-01-08 03:35:24', 'updated_at' => '2026-01-10 07:26:48'),
|
||||
array('key' => 'sms-gateway-setting-1', 'value' => '"api"', 'status' => '1', 'created_at' => now(), 'updated_at' => now()),
|
||||
);
|
||||
|
||||
Option::insert($options);
|
||||
|
||||
Artisan::call('cache:clear');
|
||||
Artisan::call('config:clear');
|
||||
Artisan::call('route:clear');
|
||||
Artisan::call('view:clear');
|
||||
}
|
||||
}
|
||||
69
Modules/MarketingAddon/Database/Seeders/TemplateSeeder.php
Normal file
69
Modules/MarketingAddon/Database/Seeders/TemplateSeeder.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MarketingAddon\Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Modules\MarketingAddon\App\Models\Template;
|
||||
|
||||
class TemplateSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$templates = array(
|
||||
array('business_id' => '1', 'title' => 'new_sale', 'type' => 'sms', 'template' => NULL, 'attachment' => NULL, 'subject' => NULL, 'variables' => '["customer_name","amount","received_amount","due_amount","invoice_url","business_name"]', 'message' => 'Dear [customer_name],
|
||||
Thanks for the purchase
|
||||
Your Invoice amount: [amount]
|
||||
Received: [received_amount] Current Due: [due_amount]
|
||||
Online invoice: [invoice_url]
|
||||
Thank You
|
||||
[business_name]', 'status' => '1', 'created_at' => '2026-01-05 05:40:37', 'updated_at' => '2026-02-01 11:01:51'),
|
||||
array('business_id' => '1', 'title' => 'payment_received', 'type' => 'sms', 'template' => NULL, 'attachment' => NULL, 'subject' => NULL, 'variables' => '["customer_name","received_amount","due_amount","invoice_url","business_name"]', 'message' => 'Dear [customer_name],
|
||||
Thanks for the payment
|
||||
Received amount: [received_amount]
|
||||
Current Due: [due_amount]
|
||||
Online invoice: [invoice_url]
|
||||
Thank You
|
||||
[business_name]', 'status' => '1', 'created_at' => '2026-01-05 05:40:37', 'updated_at' => '2026-02-01 11:17:31'),
|
||||
array('business_id' => '1', 'title' => 'payment_paid', 'type' => 'sms', 'template' => NULL, 'attachment' => NULL, 'subject' => NULL, 'variables' => '["customer_name","amount","paid_amount","due_amount","invoice_url","business_name"]', 'message' => 'Dear [customer_name],
|
||||
Your Invoice amount: [amount]
|
||||
Paid: [paid_amount] Current Due: [due_amount]
|
||||
Online invoice: [invoice_url]
|
||||
Thank You
|
||||
[business_name]', 'status' => '1', 'created_at' => '2026-01-05 05:40:37', 'updated_at' => '2026-02-01 11:14:47'),
|
||||
array('business_id' => '1', 'title' => 'purchase', 'type' => 'sms', 'template' => NULL, 'attachment' => NULL, 'subject' => NULL, 'variables' => '["supplier_name","invoice_no","date"]', 'message' => 'Dear [supplier_name], a purchase order #[invoice_no] has been placed on [date].', 'status' => '1', 'created_at' => '2026-01-05 05:40:37', 'updated_at' => '2026-01-12 11:22:45'),
|
||||
array('business_id' => '1', 'title' => 'payment_reminder', 'type' => 'sms', 'template' => NULL, 'attachment' => NULL, 'subject' => NULL, 'variables' => '["customer_name","amount","business_phone"]', 'message' => 'Hello [customer_name], kindly clear your outstanding balance of [amount]. For details, contact us at [business_phone].', 'status' => '1', 'created_at' => '2026-01-05 05:40:37', 'updated_at' => '2026-01-12 11:22:45'),
|
||||
array('business_id' => '1', 'title' => 'attendance', 'type' => 'sms', 'template' => NULL, 'attachment' => NULL, 'subject' => NULL, 'variables' => '["employee_name","entry_time","exit_time","date","business_name"]', 'message' => 'Dear [employee_name], your entry time at [entry_time] and exit time at [exit_time] on [date]. Thanks, [business_name] HR.', 'status' => '1', 'created_at' => '2026-01-29 15:35:09', 'updated_at' => '2026-02-01 10:44:36'),
|
||||
array('business_id' => '1', 'title' => 'new_sale', 'type' => 'whatsapp', 'template' => 'sell_confirmation', 'attachment' => NULL, 'subject' => NULL, 'variables' => '["customer_name","amount","received_amount","due_amount","invoice_url","business_name"]', 'message' => 'Dear [customer_name],
|
||||
Thanks for the purchase
|
||||
Your Invoice amount: [amount]
|
||||
Received: [received_amount] Current Due: [due_amount]
|
||||
Online invoice: [invoice_url]
|
||||
Thank You
|
||||
[business_name]', 'status' => '1', 'created_at' => '2026-01-05 05:40:37', 'updated_at' => '2026-02-01 11:02:07'),
|
||||
array('business_id' => '1', 'title' => 'payment_received', 'type' => 'whatsapp', 'template' => NULL, 'attachment' => NULL, 'subject' => NULL, 'variables' => '["customer_name","received_amount","due_amount","invoice_url","business_name"]', 'message' => 'Dear [customer_name],
|
||||
Thanks for the payment
|
||||
Received amount: [received_amount]
|
||||
Current Due: [due_amount]
|
||||
Online invoice: [invoice_url]
|
||||
Thank You
|
||||
[business_name]', 'status' => '1', 'created_at' => '2026-01-05 05:40:37', 'updated_at' => '2026-02-01 11:17:48'),
|
||||
array('business_id' => '1', 'title' => 'payment_paid', 'type' => 'whatsapp', 'template' => NULL, 'attachment' => NULL, 'subject' => NULL, 'variables' => '["customer_name","amount","paid_amount","due_amount","invoice_url","business_name"]', 'message' => 'Dear [customer_name],
|
||||
Your Invoice amount: [amount]
|
||||
Paid: [paid_amount] Current Due: [due_amount]
|
||||
Online invoice: [invoice_url]
|
||||
Thank You
|
||||
[business_name]', 'status' => '1', 'created_at' => '2026-01-05 05:40:37', 'updated_at' => '2026-02-01 11:14:24'),
|
||||
array('business_id' => '1', 'title' => 'purchase', 'type' => 'whatsapp', 'template' => NULL, 'attachment' => NULL, 'subject' => NULL, 'variables' => '["supplier_name","invoice_no","date"]', 'message' => 'Dear [supplier_name], a purchase order #[invoice_no] has been placed on [date].', 'status' => '1', 'created_at' => '2026-01-05 05:40:37', 'updated_at' => '2026-01-12 11:22:45'),
|
||||
array('business_id' => '1', 'title' => 'payment_reminder', 'type' => 'whatsapp', 'template' => NULL, 'attachment' => NULL, 'subject' => NULL, 'variables' => '["customer_name","amount","business_phone"]', 'message' => 'Hello [customer_name], kindly clear your outstanding balance of [amount]. For details, contact us at [business_phone].', 'status' => '1', 'created_at' => '2026-01-05 05:40:37', 'updated_at' => '2026-01-12 11:22:45'),
|
||||
array('business_id' => '1', 'title' => 'attendance', 'type' => 'whatsapp', 'template' => NULL, 'attachment' => NULL, 'subject' => NULL, 'variables' => '["employee_name","entry_time","exit_time","date","business_name"]', 'message' => 'Dear [employee_name], your entry time at [entry_time] and exit time at [exit_time] on [date]. Thanks, [business_name] HR.', 'status' => '1', 'created_at' => '2026-01-29 15:35:09', 'updated_at' => '2026-02-01 10:45:32'),
|
||||
array('business_id' => '1', 'title' => 'new_sale', 'type' => 'email', 'template' => NULL, 'attachment' => NULL, 'subject' => 'New Sale', 'variables' => '["customer_name","amount","received_amount","due_amount","invoice_url","business_name"]', 'message' => '<div>Dear [customer_name],</div><div>Thanks for the purchase</div><div>Your Invoice amount: [amount]</div><div>Received: [received_amount] Current Due: [due_amount]</div><div>Online invoice: [invoice_url]</div><div>Thank You</div><div>[business_name]</div>', 'status' => '1', 'created_at' => '2026-01-05 05:40:37', 'updated_at' => '2026-02-01 11:02:32'),
|
||||
array('business_id' => '1', 'title' => 'payment_received', 'type' => 'email', 'template' => NULL, 'attachment' => NULL, 'subject' => 'Payment Received', 'variables' => '["customer_name","received_amount","due_amount","invoice_url","business_name"]', 'message' => '<div>Dear [customer_name],</div><div>Thanks for the payment </div><div>Received amount: [received_amount]</div><div>Current Due: [due_amount]</div><div>Online invoice: [invoice_url]</div><div>Thank You</div><div>[business_name]</div>', 'status' => '1', 'created_at' => '2026-01-05 05:40:37', 'updated_at' => '2026-02-01 11:18:28'),
|
||||
array('business_id' => '1', 'title' => 'payment_paid', 'type' => 'email', 'template' => NULL, 'attachment' => NULL, 'subject' => 'Payment Paid', 'variables' => '["customer_name","amount","paid_amount","due_amount","invoice_url","business_name"]', 'message' => '<div>Dear [customer_name],</div><div>Your Invoice amount: [amount]</div><div>Paid: [paid_amount] Current Due: [due_amount]</div><div>Online invoice: [invoice_url]</div><div>Thank You</div><div>[business_name]</div>', 'status' => '1', 'created_at' => '2026-01-05 05:40:37', 'updated_at' => '2026-02-01 11:14:14'),
|
||||
array('business_id' => '1', 'title' => 'purchase', 'type' => 'email', 'template' => NULL, 'attachment' => NULL, 'subject' => 'Purchase', 'variables' => '["supplier_name","invoice_no","date"]', 'message' => 'Dear [supplier_name], a purchase order #[invoice_no] has been placed on [date].', 'status' => '1', 'created_at' => '2026-01-05 05:40:37', 'updated_at' => '2026-01-12 11:22:45'),
|
||||
array('business_id' => '1', 'title' => 'payment_reminder', 'type' => 'email', 'template' => NULL, 'attachment' => NULL, 'subject' => 'Payment Reminder', 'variables' => '["customer_name","amount","business_phone"]', 'message' => 'Hello [customer_name], kindly clear your outstanding balance of [amount]. For details, contact us at [business_phone].', 'status' => '1', 'created_at' => '2026-01-05 05:40:37', 'updated_at' => '2026-01-12 11:22:45'),
|
||||
array('business_id' => '1', 'title' => 'attendance', 'type' => 'email', 'template' => NULL, 'attachment' => NULL, 'subject' => 'Attendance', 'variables' => '["employee_name","entry_time","exit_time","date","business_name"]', 'message' => '<span data-teams="true">Dear [employee_name], your entry time at [entry_time] and exit time at [exit_time] on [date]. Thanks, [business_name] HR.</span>', 'status' => '1', 'created_at' => '2026-01-29 15:35:09', 'updated_at' => '2026-02-01 10:46:41')
|
||||
);
|
||||
|
||||
Template::insert($templates);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('gateway_types', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->longText('inputs');
|
||||
$table->string('namespace')->nullable();
|
||||
$table->string('driver')->nullable();
|
||||
$table->boolean('status')->default(1);
|
||||
$table->string('channel')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('gateway_types');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('smsgateways', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->foreignId('business_id')->constrained()->cascadeOnDelete();
|
||||
$table->foreignId('type_id')->constrained('gateway_types')->cascadeOnDelete();
|
||||
$table->boolean('status')->default(1);
|
||||
$table->string('driver')->nullable();
|
||||
$table->string('channel')->nullable();
|
||||
$table->string('namespace')->nullable();
|
||||
$table->longText('params')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('smsgateways');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('templates', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('business_id')->nullable()->constrained()->nullOnDelete();
|
||||
$table->string('title');
|
||||
$table->string('type'); // sms, whatsapp, email
|
||||
$table->string('template')->nullable(); // for whatsapp only
|
||||
$table->string('attachment')->nullable();
|
||||
$table->string('subject')->nullable(); // for email only
|
||||
$table->text('variables')->nullable();
|
||||
$table->longText('message')->nullable();
|
||||
$table->boolean('status')->default(1);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('templates');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('message_reports', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title')->nullable();
|
||||
$table->foreignId('business_id')->constrained()->cascadeOnDelete();
|
||||
$table->foreignId('template_id')->nullable()->constrained()->nullOnDelete();
|
||||
$table->foreignId('smsgateway_id')->nullable()->constrained()->nullOnDelete();
|
||||
$table->foreignId('user_id')->nullable()->constrained()->nullOnDelete(); // Send To
|
||||
$table->string('channel'); // sms, whatsapp, email
|
||||
$table->string('phone')->nullable();
|
||||
$table->longText('message')->nullable();
|
||||
$table->string('attachment')->nullable();
|
||||
$table->timestamp('send_at')->nullable();
|
||||
$table->enum('status', ['pending', 'success', 'failed'])->default('pending');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('message_reports');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('email_settings', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('business_id')->constrained()->cascadeOnDelete();
|
||||
$table->enum('driver', ['smtp', 'sendmail'])->default('smtp');
|
||||
$table->string('host')->nullable();
|
||||
$table->string('port')->nullable();
|
||||
$table->string('username')->nullable();
|
||||
$table->string('password')->nullable();
|
||||
$table->string('encryption')->nullable();
|
||||
$table->string('from_name')->nullable();
|
||||
$table->string('from_address')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('email_settings');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user