Add stubs for various Laravel components and scaffolding
- Created stubs for JavaScript and SASS assets. - Added stubs for channel, command, component, controller, event, factory, job, listener, mail, middleware, migration, model, notification, observer, policy, request, resource, route provider, seeder, and validation rule. - Implemented scaffolding for configuration, service provider, and Vite integration. - Included example views for module structure. - Introduced a module loader for Vite to handle asset paths dynamically.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail\Admin;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class ManualDepositPendingNotification extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public function __construct(public array $data) {}
|
||||
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: '[ADMIN] Yêu cầu nạp tiền chờ duyệt - ' . ($this->data['transaction_code'] ?? 'N/A'),
|
||||
);
|
||||
}
|
||||
|
||||
public function content(): Content
|
||||
{
|
||||
return new Content(
|
||||
view: 'emails.admin.manual-deposit-pending',
|
||||
with: $this->data,
|
||||
);
|
||||
}
|
||||
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail\Customer;
|
||||
|
||||
use App\Models\Setting;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class ManualDepositStatus extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public function __construct(public array $data) {}
|
||||
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: $this->payload()['subject'] ?? 'Thông báo trạng thái nạp tiền',
|
||||
);
|
||||
}
|
||||
|
||||
public function content(): Content
|
||||
{
|
||||
$data = $this->payload();
|
||||
|
||||
return new Content(
|
||||
view: 'emails.customer.manual-deposit-status',
|
||||
with: [
|
||||
'companyName' => $data['company_name'] ?? config('app.name', 'The Gioi So'),
|
||||
'companyLogo' => $data['company_logo'] ?? '',
|
||||
'customerName' => $data['customer_name'] ?? 'Quý khách',
|
||||
'transactionCode' => $data['transaction_code'] ?? 'N/A',
|
||||
'amount' => $data['amount'] ?? 0,
|
||||
'amountFormatted' => number_format((float) ($data['amount'] ?? 0), 0, ',', '.'),
|
||||
'statusLabel' => $data['status_label'] ?? 'Đang chờ duyệt',
|
||||
'statusColor' => $data['status_color'] ?? '#f16723',
|
||||
'statusBg' => $data['status_bg'] ?? '#fff7ed',
|
||||
'statusMessage' => $data['status_message'] ?? ($data['message'] ?? ''),
|
||||
'depositDate' => $data['deposit_date'] ?? now()->format('d/m/Y H:i:s'),
|
||||
'processedDate' => $data['processed_date'] ?? null,
|
||||
'portalUrl' => $data['portal_url'] ?? rtrim(env('FRONTEND_URL', config('app.url')), '/') . '/nap-tien',
|
||||
'supportEmail' => $data['support_email'] ?? config('mail.support_email', 'support@thegioiso.com'),
|
||||
'supportPhone' => $data['support_phone'] ?? config('mail.support_phone', '1900.xxxx'),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
private function payload(): array
|
||||
{
|
||||
try {
|
||||
$setting = Setting::where('key', 'setting')->first();
|
||||
$settingValue = $setting ? json_decode((string) $setting->value, true) : [];
|
||||
} catch (\Throwable) {
|
||||
$settingValue = [];
|
||||
}
|
||||
|
||||
return array_merge([
|
||||
'company_name' => $settingValue['company'] ?? config('app.name', 'The Gioi So'),
|
||||
'company_logo' => $settingValue['logo'] ?? '',
|
||||
'support_email' => $settingValue['email'] ?? config('mail.support_email', 'support@thegioiso.com'),
|
||||
'support_phone' => $settingValue['hotline'] ?? ($settingValue['phone'] ?? config('mail.support_phone', '1900.xxxx')),
|
||||
'portal_url' => rtrim(env('FRONTEND_URL', config('app.url')), '/') . '/nap-tien',
|
||||
], $this->data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user