'free'], [ 'name' => 'Free', 'price_monthly' => 0, 'currency' => 'MDL', 'features' => ['core'], 'limits' => ['max_users' => 2, 'max_vehicles' => 50], ]); Plan::firstOrCreate(['slug' => 'basic'], [ 'name' => 'Basic', 'price_monthly' => 299, 'currency' => 'MDL', 'features' => ['core', 'workorders', 'kanban'], 'limits' => ['max_users' => 5, 'max_vehicles' => 500], ]); Plan::firstOrCreate(['slug' => 'pro'], [ 'name' => 'Pro', 'price_monthly' => 599, 'currency' => 'MDL', 'features' => ['core', 'workorders', 'kanban', 'reports', 'ai', 'api'], 'limits' => ['max_users' => -1, 'max_vehicles' => -1], ]); // ─── Super-admin (operator platformă) ───────────────────── SuperAdmin::firstOrCreate(['email' => 'vasyka.moraru@gmail.com'], [ 'name' => 'Vasyka', 'password' => Hash::make('admin123'), 'is_active' => true, ]); // ─── PSauto demo company ────────────────────────────────── $psauto = Company::firstOrCreate(['slug' => 'psauto'], [ 'name' => 'PSauto SRL', 'display_name' => 'PSauto', 'city' => 'Chișinău', 'phone' => '+373 22 123 456', 'email' => 'contact@psauto.md', 'contact_name' => 'Manager PSauto', 'status' => 'active', 'plan_id' => $free->id, 'active_until' => now()->addYear(), 'settings' => [ 'currency' => 'MDL', 'language' => 'ro', 'theme_color' => '#3B82F6', 'labor_rate' => 400, 'posts' => ['Post 1', 'Post 2', 'Post 3'], ], ]); // Activate tenant context for the seeded data so global scopes auto-fill company_id. app(TenantManager::class)->setCurrent($psauto); // ─── Admin user pentru PSauto ───────────────────────────── User::firstOrCreate( ['company_id' => $psauto->id, 'email' => 'admin@psauto.md'], [ 'name' => 'Administrator PSauto', 'password' => Hash::make('admin123'), 'role' => 'admin', 'status' => 'active', 'phone' => '+373 22 123 456', 'locale' => 'ro', 'email_verified_at' => now(), ] ); // ─── Clienți demo (din AutoCRM.html) ────────────────────── $c1 = Client::firstOrCreate( ['company_id' => $psauto->id, 'phone' => '+373 69 100001'], [ 'type' => 'individual', 'name' => 'Ion Popescu', 'email' => 'ion@mail.com', 'status' => 'vip', 'source' => 'recommend', ] ); $c2 = Client::firstOrCreate( ['company_id' => $psauto->id, 'phone' => '+373 79 200002'], [ 'type' => 'individual', 'name' => 'Maria Dumitru', 'status' => 'active', 'discount_pct' => 5, 'source' => 'site', ] ); $c3 = Client::firstOrCreate( ['company_id' => $psauto->id, 'phone' => '+373 60 300003'], [ 'type' => 'individual', 'name' => 'Andrei Lupu', 'status' => 'active', 'discount_pct' => 10, 'notes' => 'Doar piese originale', 'source' => 'instagram', ] ); // ─── Mașini demo ────────────────────────────────────────── Vehicle::firstOrCreate( ['company_id' => $psauto->id, 'client_id' => $c1->id, 'make' => 'BMW', 'model' => 'X5'], ['year' => 2020, 'plate' => 'CIU 001', 'engine' => '3.0i', 'gearbox' => 'Automat 8AT', 'fuel' => 'Benzină', 'mileage' => 85000, 'color' => 'Alb'] ); Vehicle::firstOrCreate( ['company_id' => $psauto->id, 'client_id' => $c2->id, 'make' => 'Audi', 'model' => 'A4'], ['year' => 2019, 'plate' => 'CIU 002', 'engine' => '2.0 TDI', 'gearbox' => 'DSG7', 'fuel' => 'Diesel', 'mileage' => 45000, 'color' => 'Negru'] ); Vehicle::firstOrCreate( ['company_id' => $psauto->id, 'client_id' => $c3->id, 'make' => 'Porsche', 'model' => 'Cayenne'], ['year' => 2021, 'plate' => 'CIU 003', 'engine' => '3.0 TDI', 'gearbox' => 'Tiptronic', 'fuel' => 'Diesel', 'mileage' => 22000, 'color' => 'Gri'] ); app(TenantManager::class)->clear(); } }