2024-12-02 01:18:34 +07:00
|
|
|
<?php
|
|
|
|
|
|
2024-12-12 18:18:26 +07:00
|
|
|
namespace Database\Seeds;
|
|
|
|
|
|
2024-12-11 12:29:37 +07:00
|
|
|
use App\Models\Admin;
|
2024-12-02 01:18:34 +07:00
|
|
|
use Illuminate\Database\Seeder;
|
2024-12-11 12:29:37 +07:00
|
|
|
use Illuminate\Support\Facades\Hash;
|
2024-12-02 01:18:34 +07:00
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
use Carbon\Carbon;
|
|
|
|
|
|
2024-12-11 12:29:37 +07:00
|
|
|
class MenuSeeder extends Seeder
|
2024-12-02 01:18:34 +07:00
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Run the database seeds.
|
2024-12-11 12:29:37 +07:00
|
|
|
*
|
|
|
|
|
* @return void
|
2024-12-02 01:18:34 +07:00
|
|
|
*/
|
2024-12-11 12:29:37 +07:00
|
|
|
public function run()
|
2024-12-02 01:18:34 +07:00
|
|
|
{
|
|
|
|
|
DB::table('menus')->insert([
|
|
|
|
|
[
|
|
|
|
|
'id' => 61,
|
|
|
|
|
'title' => 'Role Manager',
|
|
|
|
|
'url' => '/admin/roles',
|
|
|
|
|
'icon' => 'mdi mdi-account-key-outline',
|
|
|
|
|
'parent_id' => 62,
|
|
|
|
|
'order' => 1,
|
|
|
|
|
'created_at' => Carbon::now(),
|
|
|
|
|
'updated_at' => Carbon::now(),
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
'id' => 62,
|
|
|
|
|
'title' => 'System Administrator',
|
|
|
|
|
'url' => '#',
|
|
|
|
|
'icon' => 'mdi mdi-cog-outline',
|
|
|
|
|
'parent_id' => null,
|
|
|
|
|
'order' => 99,
|
|
|
|
|
'created_at' => Carbon::now(),
|
|
|
|
|
'updated_at' => Carbon::now(),
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
'id' => 63,
|
|
|
|
|
'title' => 'Users List Accounts',
|
|
|
|
|
'url' => '/admin/admins',
|
|
|
|
|
'icon' => 'mdi mdi-account-group',
|
|
|
|
|
'parent_id' => 62,
|
|
|
|
|
'order' => 0,
|
|
|
|
|
'created_at' => Carbon::now(),
|
|
|
|
|
'updated_at' => Carbon::now(),
|
|
|
|
|
]
|
|
|
|
|
]);
|
2024-12-12 18:18:26 +07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
DB::table('role_menu')->insert([
|
|
|
|
|
[
|
|
|
|
|
'role_id' => 1,
|
|
|
|
|
'menu_id' => 61,
|
|
|
|
|
'created_at' => Carbon::now(),
|
|
|
|
|
'updated_at' => Carbon::now(),
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
'role_id' => 1,
|
|
|
|
|
'menu_id' => 62,
|
|
|
|
|
'created_at' => Carbon::now(),
|
|
|
|
|
'updated_at' => Carbon::now(),
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
'role_id' => 1,
|
|
|
|
|
'menu_id' => 63,
|
|
|
|
|
'created_at' => Carbon::now(),
|
|
|
|
|
'updated_at' => Carbon::now(),
|
|
|
|
|
]
|
|
|
|
|
]);
|
2024-12-02 01:18:34 +07:00
|
|
|
}
|
|
|
|
|
}
|