12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <?php
- use Illuminate\Database\Seeder;
- use Illuminate\Support\Facades\DB;
- class PermissionsTableSeeder extends Seeder
- {
- /**
- * Run the database seeds.
- *
- * @return void
- */
- public function run()
- {
- DB::table('permissions')->insert([
- [
- 'name' => 'admins',
- 'display_name' => 'Admins',
- 'parent' => 0,
- 'guard_name' => 'admin'
- ],[
- 'name' => 'role_&_permission',
- 'display_name' => 'Role & Permission',
- 'parent' => 0,
- 'guard_name' => 'admin'
- ],[
- 'name' => 'create',
- 'display_name' => 'Create',
- 'parent' => 1,
- 'guard_name' => 'admin'
- ],[
- 'name' => 'update',
- 'display_name' => 'Update',
- 'parent' => 1,
- 'guard_name' => 'admin'
- ],[
- 'name' => 'delete',
- 'display_name' => 'Delete',
- 'parent' => 1,
- 'guard_name' => 'admin'
- ],[
- 'name' => 'roles',
- 'display_name' => 'Roles',
- 'parent' => 2,
- 'guard_name' => 'admin'
- ],[
- 'name' => 'permissions',
- 'display_name' => 'Permissions',
- 'parent' => 2,
- 'guard_name' => 'admin'
- ]
- ]);
- DB::table('roles')->insert([
- [
- 'name' => 'Super-Admin',
- 'guard_name' => 'admin'
- ]
- ]);
- DB::table('role_has_permissions')->insert([
- [
- 'permission_id' => 1,
- 'role_id' => 1
- ],[
- 'permission_id' => 2,
- 'role_id' => 1
- ],[
- 'permission_id' => 3,
- 'role_id' => 1
- ],[
- 'permission_id' => 4,
- 'role_id' => 1
- ],[
- 'permission_id' => 5,
- 'role_id' => 1
- ],[
- 'permission_id' => 6,
- 'role_id' => 1
- ],[
- 'permission_id' => 7,
- 'role_id' => 1
- ]
- ]);
- DB::table('model_has_roles')->insert([
- [
- 'role_id' => 1,
- 'model_type' => 'App\Models\Admin',
- 'model_id' => 1
- ]
- ]);
- }
- }
|