Files
citrus-cms/database/seeders/NaksPoolMenuSeeder.php
T
2026-04-28 21:15:09 +03:00

72 lines
2.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
/**
* NAKS Pool Menu Seeder - Dashboard Only
*
* This seeder adds only the Dashboard menu for NAKS Pool.
* Other sub-menus (Welder, Technology, Consumables, Equipment) are excluded.
*
* Usage:
* php artisan db:seed --class=NaksPoolMenuSeeder
*/
class NaksPoolMenuSeeder extends Seeder
{
public function run()
{
// 1. Parent menu: NAKS Pool (Inter-site)
$parentExists = DB::table('types')->where('slug', 'naks-pool')->exists();
if (!$parentExists) {
DB::table('types')->insert([
'title' => 'NAKS Pool',
'slug' => 'naks-pool',
'kid' => null,
'icon' => '11.3 Naks Welder',
'enabled' => true,
'read' => '1,24,2,3,7,8,12,14,16,23',
's' => 100,
'created_at' => now(),
'updated_at' => now(),
]);
$this->command->info('✅ Parent menu added: NAKS Pool');
} else {
$this->command->info('ℹ️ Parent menu already exists: NAKS Pool');
}
// 2. Child menu: Dashboard (only sub-menu for now)
$dashboardExists = DB::table('types')->where('slug', 'naks-pool-dashboard')->exists();
if (!$dashboardExists) {
DB::table('types')->insert([
'title' => 'Dashboard',
'slug' => 'naks-pool-dashboard',
'kid' => 'naks-pool',
'icon' => 'dashboard',
'enabled' => true,
'read' => '1,24,2,3,7,8,12,14,16,23',
's' => 1,
'created_at' => now(),
'updated_at' => now(),
]);
$this->command->info('✅ Child menu added: Dashboard');
} else {
$this->command->info('ℹ️ Child menu already exists: Dashboard');
}
// NOTE: Other menus (Welder, Technology, Consumables, Equipment)
// are excluded from this version. They will be added in future PRs.
$this->command->info('');
$this->command->info('🎉 NAKS Pool menu seeder completed! (Dashboard only)');
$this->command->info('');
$this->command->info('📋 Note: Run "php artisan cache:clear" after seeding.');
}
}