- $admin = new \BookStack\Role();
- $admin->name = 'admin';
- $admin->display_name = 'Admin';
- $admin->description = 'Administrator of the whole application';
- $admin->save();
-
- $editor = new \BookStack\Role();
- $editor->name = 'editor';
- $editor->display_name = 'Editor';
- $editor->description = 'User can edit Books, Chapters & Pages';
- $editor->save();
-
- $viewer = new \BookStack\Role();
- $viewer->name = 'viewer';
- $viewer->display_name = 'Viewer';
- $viewer->description = 'User can view books & their content behind authentication';
- $viewer->save();
+ $adminId = DB::table('roles')->insertGetId([
+ 'name' => 'admin',
+ 'display_name' => 'Admin',
+ 'description' => 'Administrator of the whole application',
+ 'created_at' => \Carbon\Carbon::now()->toDateTimeString(),
+ 'updated_at' => \Carbon\Carbon::now()->toDateTimeString()
+ ]);
+ $editorId = DB::table('roles')->insertGetId([
+ 'name' => 'editor',
+ 'display_name' => 'Editor',
+ 'description' => 'User can edit Books, Chapters & Pages',
+ 'created_at' => \Carbon\Carbon::now()->toDateTimeString(),
+ 'updated_at' => \Carbon\Carbon::now()->toDateTimeString()
+ ]);
+ $viewerId = DB::table('roles')->insertGetId([
+ 'name' => 'viewer',
+ 'display_name' => 'Viewer',
+ 'description' => 'User can view books & their content behind authentication',
+ 'created_at' => \Carbon\Carbon::now()->toDateTimeString(),
+ 'updated_at' => \Carbon\Carbon::now()->toDateTimeString()
+ ]);
+