feat(admin): improve payments and server settings
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('dns_manager_servers', function (Blueprint $table) {
|
||||
$table->string('domain')->nullable()->after('ip_address');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('dns_manager_servers', function (Blueprint $table) {
|
||||
$table->dropColumn('domain');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use App\Support\EmailTemplateShell;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
private const SCENARIO = 'admin_payment_received';
|
||||
|
||||
public function up(): void
|
||||
{
|
||||
if (DB::table('template')->where('scenario', self::SCENARIO)->exists()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$body = EmailTemplateShell::title('Khách hàng vừa thanh toán')
|
||||
. EmailTemplateShell::paragraph('Hệ thống <strong>{{company_name}}</strong> vừa ghi nhận một khoản thanh toán mới.')
|
||||
. EmailTemplateShell::infoTable([
|
||||
'Loại thanh toán' => '{{payment_type}}',
|
||||
'Mã tham chiếu' => '#{{reference}}',
|
||||
'Số hóa đơn' => '{{invoice_number}}',
|
||||
'Khách hàng' => '{{customer_name}}',
|
||||
'Email' => '{{customer_email}}',
|
||||
'Số tiền vừa trả' => '{{amount_formatted}}',
|
||||
'Còn thiếu' => '{{outstanding_formatted}}',
|
||||
'Trạng thái' => '{{payment_status}}',
|
||||
'Thời gian' => '{{created_at}}',
|
||||
]);
|
||||
|
||||
DB::table('template')->insert([
|
||||
'type_id' => 0,
|
||||
'scenario' => self::SCENARIO,
|
||||
'key' => self::SCENARIO,
|
||||
'format' => 'html',
|
||||
'name' => '[Admin] Khách hàng thanh toán',
|
||||
'subject' => '[ADMIN] Khách hàng thanh toán {{payment_type}} #{{reference}}',
|
||||
'message' => EmailTemplateShell::wrap(EmailTemplateShell::body($body)),
|
||||
'metadata' => json_encode(['variables' => []], JSON_UNESCAPED_UNICODE),
|
||||
'status' => 1,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
DB::table('template')->where('scenario', self::SCENARIO)->delete();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user