Remove old Vuexy wrapper components (AppTextField, AppSelect, AppTextarea, FlashMessages, NotificationBell)
All pages now use native Vuetify components directly. Flash messages are handled by the ToastStack component via Pinia store. Notifications use NotificationPanel. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -850,10 +850,64 @@ class DemoDataSeeder extends Seeder
|
||||
$createdAt = now()->subDays(rand(1, 180));
|
||||
|
||||
$changes = null;
|
||||
if (str_contains($actionDef['action'], 'updated') || str_contains($actionDef['action'], 'suspended') || str_contains($actionDef['action'], 'banned')) {
|
||||
$action = $actionDef['action'];
|
||||
|
||||
// Generate realistic changes based on action type
|
||||
if ($action === 'customer.updated') {
|
||||
// Per-field old/new format (most common for updates)
|
||||
$changes = json_encode([
|
||||
'name' => ['old' => $faker->name(), 'new' => $faker->name()],
|
||||
'email' => ['old' => $faker->safeEmail(), 'new' => $faker->safeEmail()],
|
||||
]);
|
||||
} elseif ($action === 'customer.suspended' || $action === 'customer.banned') {
|
||||
// Per-field old/new for status changes
|
||||
$newStatus = str_contains($action, 'suspended') ? 'suspended' : 'banned';
|
||||
$changes = json_encode([
|
||||
'status' => ['old' => 'active', 'new' => $newStatus],
|
||||
]);
|
||||
} elseif ($action === 'service.updated') {
|
||||
// Per-field old/new with plan change
|
||||
$plans = ['Starter VPS', 'Basic VPS', 'Pro VPS', 'Enterprise VPS', 'Basic Dedicated', 'Pro Dedicated'];
|
||||
$oldPlan = $faker->randomElement($plans);
|
||||
$newPlan = $faker->randomElement(array_diff($plans, [$oldPlan]));
|
||||
$changes = json_encode([
|
||||
'plan' => ['old' => $oldPlan, 'new' => $newPlan],
|
||||
'status' => ['old' => 'active', 'new' => 'active'],
|
||||
]);
|
||||
} elseif ($action === 'plan.updated') {
|
||||
// Per-field old/new with pricing
|
||||
$changes = json_encode([
|
||||
'price' => ['old' => number_format($faker->randomFloat(2, 5, 50), 2), 'new' => number_format($faker->randomFloat(2, 5, 50), 2)],
|
||||
'name' => ['old' => $faker->word().' Plan', 'new' => $faker->word().' Plan'],
|
||||
'disk_space' => ['old' => $faker->randomElement(['20GB', '50GB', '100GB']), 'new' => $faker->randomElement(['50GB', '100GB', '200GB'])],
|
||||
]);
|
||||
} elseif ($action === 'settings.updated') {
|
||||
// Per-field old/new for settings
|
||||
$changes = json_encode([
|
||||
'site_name' => ['old' => 'EZSCALE Cloud', 'new' => 'EZSCALE Cloud Hosting'],
|
||||
'maintenance_mode' => ['old' => false, 'new' => true],
|
||||
]);
|
||||
} elseif (str_contains($action, 'created') || str_contains($action, 'completed')) {
|
||||
// Top-level old/new (new only = create)
|
||||
$changes = json_encode([
|
||||
'old' => null,
|
||||
'new' => [
|
||||
'status' => $faker->randomElement(['active', 'pending', 'completed']),
|
||||
'amount' => number_format($faker->randomFloat(2, 10, 500), 2),
|
||||
],
|
||||
]);
|
||||
} elseif (str_contains($action, 'cancelled') || str_contains($action, 'voided')) {
|
||||
// Top-level old/new (both = update)
|
||||
$changes = json_encode([
|
||||
'old' => ['status' => 'active'],
|
||||
'new' => ['status' => $faker->randomElement(['suspended', 'banned', 'active'])],
|
||||
'new' => ['status' => $faker->randomElement(['cancelled', 'voided'])],
|
||||
]);
|
||||
} elseif ($action === 'impersonation.started') {
|
||||
// Flat key-value data
|
||||
$changes = json_encode([
|
||||
'target_user' => $faker->name(),
|
||||
'target_email' => $faker->safeEmail(),
|
||||
'reason' => 'Support request',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
81
website/database/seeders/EmailTemplateSeeder.php
Normal file
81
website/database/seeders/EmailTemplateSeeder.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\EmailTemplate;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class EmailTemplateSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$templates = $this->getDefaultTemplates();
|
||||
|
||||
foreach ($templates as $template) {
|
||||
EmailTemplate::query()->updateOrCreate(
|
||||
['slug' => $template['slug']],
|
||||
$template,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<int, array{slug: string, name: string, subject: string, body: string, available_variables: array<int, string>}>
|
||||
*/
|
||||
public static function getDefaultTemplates(): array
|
||||
{
|
||||
return [
|
||||
[
|
||||
'slug' => 'payment-succeeded',
|
||||
'name' => 'Payment Succeeded',
|
||||
'subject' => 'Payment of {{currency}} {{amount}} Received',
|
||||
'body' => "Hello {{customer_name}}!\n\nWe've successfully processed your payment of **{{currency}} {{amount}}**.\n\nInvoice: #{{invoice_number}}\nDate: {{date}}\n\nThank you for choosing EZSCALE!",
|
||||
'available_variables' => ['customer_name', 'amount', 'currency', 'invoice_number', 'date'],
|
||||
],
|
||||
[
|
||||
'slug' => 'payment-failed',
|
||||
'name' => 'Payment Failed',
|
||||
'subject' => 'Payment Failed - Action Required',
|
||||
'body' => "Hello {{customer_name}},\n\nWe were unable to process your payment of **{{currency}} {{amount}}**.\n\nPayment method: {{payment_method}}\nReason: {{error_message}}\n\nPlease update your payment method to avoid service interruption.\n\nIf you need assistance, please contact our support team.",
|
||||
'available_variables' => ['customer_name', 'amount', 'currency', 'payment_method', 'error_message'],
|
||||
],
|
||||
[
|
||||
'slug' => 'subscription-created',
|
||||
'name' => 'Subscription Created',
|
||||
'subject' => 'Subscription Confirmed - {{plan_name}}',
|
||||
'body' => "Welcome aboard, {{customer_name}}!\n\nYour subscription to **{{plan_name}}** has been created successfully.\n\nAmount: **{{currency}} {{amount}}**\nBilling cycle: **{{billing_cycle}}**\n\nYour service is being provisioned and will be ready shortly.\n\nThank you for choosing EZSCALE!",
|
||||
'available_variables' => ['customer_name', 'plan_name', 'amount', 'currency', 'billing_cycle'],
|
||||
],
|
||||
[
|
||||
'slug' => 'subscription-cancelled',
|
||||
'name' => 'Subscription Cancelled',
|
||||
'subject' => 'Subscription Cancelled - {{plan_name}}',
|
||||
'body' => "Hello {{customer_name}},\n\nYour subscription to **{{plan_name}}** has been cancelled.\n\nCancellation date: {{cancellation_date}}\nService active until: {{end_date}}\n\nYour service will remain active until the end of your current billing period. You can resubscribe at any time to continue using our services.\n\nWe hope to see you again soon!",
|
||||
'available_variables' => ['customer_name', 'plan_name', 'cancellation_date', 'end_date'],
|
||||
],
|
||||
[
|
||||
'slug' => 'service-provisioned',
|
||||
'name' => 'Service Provisioned',
|
||||
'subject' => 'Your {{service_type}} Service is Ready!',
|
||||
'body' => "Hello {{customer_name}}!\n\nYour **{{service_type}}** service has been provisioned and is ready to use.\n\nPlan: **{{plan_name}}**\nHostname: **{{hostname}}**\nIP Address: **{{ip_address}}**\n\nIf you need help getting started, check our knowledge base or contact support.",
|
||||
'available_variables' => ['customer_name', 'service_type', 'hostname', 'ip_address', 'plan_name'],
|
||||
],
|
||||
[
|
||||
'slug' => 'invoice-generated',
|
||||
'name' => 'Invoice Generated',
|
||||
'subject' => 'Invoice #{{invoice_number}} - {{currency}} {{amount}}',
|
||||
'body' => "Hello {{customer_name}},\n\nA new invoice has been generated for your account.\n\nInvoice: **#{{invoice_number}}**\nAmount: **{{currency}} {{amount}}**\nDue date: **{{due_date}}**\n\nThank you for your business!",
|
||||
'available_variables' => ['customer_name', 'invoice_number', 'amount', 'currency', 'due_date'],
|
||||
],
|
||||
[
|
||||
'slug' => 'service-credentials',
|
||||
'name' => 'Service Credentials',
|
||||
'subject' => 'Your {{service_type}} Server Credentials - EZSCALE',
|
||||
'body' => "Hello {{customer_name}}!\n\nYour **{{service_type}}** service has been provisioned and is ready to use.\n\nHere are your access credentials:\n\n**Hostname:** {{hostname}}\n**IP Address:** {{ip_address}}\n**Username:** {{username}}\n**Password:** {{password}}\n\nFor security, we recommend changing your password after first login.\n\nIf you need help, our support team is available 24/7.",
|
||||
'available_variables' => ['customer_name', 'service_type', 'hostname', 'username', 'password', 'ip_address'],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user