<?php

declare(strict_types=1);

namespace Database\Seeders;

// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use App\Models\Menu;
use App\Models\User;
use Illuminate\Database\Seeder;

class MenusTableSeeder extends Seeder
{
    /**
     * Seed the application's database.
     */
    public function run(): void
    {
        $admin = User::role('admin')->first();

        $panelMenu = Menu::create([
            'title' => 'پنل کاربری',
            'url' => '',
            'order_id' => 1,
            'icon' => '',
            'created_by' => $admin->id,
            'parent_id' => null,
        ]);

        Menu::create([
            'title' => 'اطلاعات کاربری',
            'url' => 'panel/dashboard',
            'order_id' => 1,
            'icon' => 'files/default_icon.png',
            'created_by' => $admin->id,
            'parent_id' => $panelMenu->id,
        ]);

        Menu::create([
            'title' => 'لیست علاقه‌مندی‌ها',
            'url' => 'panel/wishlist',
            'order_id' => 2,
            'icon' => 'files/default_icon.png',
            'created_by' => $admin->id,
            'parent_id' => $panelMenu->id,
        ]);

        Menu::create([
            'title' => 'لیست سفارشات',
            'url' => 'panel/order',
            'order_id' => 3,
            'icon' => 'files/default_icon.png',
            'created_by' => $admin->id,
            'parent_id' => $panelMenu->id,
        ]);
    }
}
