mirror of https://github.com/4xmen/xshop.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.1 KiB
PHP
49 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\Group;
|
|
use App\Models\Menu;
|
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class MenuSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
//
|
|
Menu::factory(['name' => 'main-menu'])->create();
|
|
|
|
Menu::first()->items()->createMany([
|
|
[
|
|
'title' => "Home",
|
|
'meta' => '/',
|
|
'user_id' => 1,
|
|
'kind'=>'direct',
|
|
],
|
|
[
|
|
'title' => "News",
|
|
'menuable_id' => 1,
|
|
'menuable_type' => Group::class,
|
|
'user_id' => 1,
|
|
'kind'=>'direct',
|
|
],
|
|
[
|
|
'title' => "Contact",
|
|
'meta' => '/contact-us',
|
|
'user_id' => 1,
|
|
'kind'=>'direct',
|
|
],
|
|
[
|
|
'title' => "About",
|
|
'meta' => '/about-us',
|
|
'user_id' => 1,
|
|
'kind'=>'direct',
|
|
],
|
|
]);
|
|
}
|
|
}
|