feat: add domain registration form and email notifications

- Create a new Blade view for domain registration (`registrant-tochuc.blade.php`) to capture organization and manager details.
- Implement email templates for new domain orders for both admin (`domain-order-new.blade.php`) and customers (`domain-order-received.blade.php`).
- Add CSV exports for client and domain data.
- Introduce tests for customer mass assignment, password reset, login throttling, and permission gating.
- Ensure service renewals use current pricing and validate ownership for virtual machines.
- Validate mass assignment behavior in service model.
This commit is contained in:
baodev0
2026-08-22 17:30:55 +07:00
parent eec2c5906e
commit c377c7e195
58 changed files with 3063 additions and 418 deletions
+10 -15
View File
@@ -2,42 +2,37 @@
namespace App\Mail\Admin;
use App\Models\Template;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class DomainOrderNewNotification extends Mailable
class DomainOrderNewNotification extends Mailable implements ShouldQueue
{
use Queueable, SerializesModels;
public function __construct(
protected Template $template,
protected array $data,
) {}
public function envelope(): Envelope
{
return new Envelope(
subject: str_replace('{\$domain_name}', $this->data['domain_name'] ?? '', $this->template->subject),
subject: "[ADMIN] Đơn đăng ký tên miền mới - {$this->data['domain_name']}",
);
}
public function content(): Content
{
$message = str_replace(
['{\$company_name}', '{\$company_logo}', '{\$domain_name}', '{\$customer_name}', '{\$customer_email}', '{\$order_num}', '{\$order_total}', '{\$created_at}', '{\$admin_url}'],
[$this->data['company_name'] ?? '', $this->data['company_logo'] ?? '', $this->data['domain_name'] ?? '', $this->data['customer_name'] ?? '', $this->data['customer_email'] ?? '', $this->data['order_num'] ?? '', $this->data['order_total'] ?? '', $this->data['created_at'] ?? '', $this->data['admin_url'] ?? ''],
$this->template->message
return new Content(
view: 'emails.layouts.notification',
with: [
'companyName' => $this->data['company_name'] ?? config('app.name'),
'title' => 'Thông báo đơn đăng ký tên miền mới',
'body' => view('emails.admin.domain-order-new', $this->data)->render(),
],
);
return new Content(view: 'emails.template', with: ['template' => $message]);
}
public function attachments(): array
{
return [];
}
}