ikinci temizlik tamamlandı
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
<?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.');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user