public function run() { DB::statement("SET foreign_key_checks = 0"); Role::truncate(); Role::create(['name' => 'user']); Role::create(['name' => 'administrator']); }
/** * Run the database seeds. * * @return void */ public function run() { DB::statement('SET FOREIGN_KEY_CHECKS=0'); User::truncate(); Role::truncate(); Permission::truncate(); DB::statement('SET FOREIGN_KEY_CHECKS=1'); Model::unguard(); $this->call(UserTableSeeder::class); $this->call(RolesTableSeeder::class); $this->call(PermissionsTableSeeder::class); Model::reguard(); }
public function run() { Role::truncate(); $role = Role::create(['id' => 1, 'name' => 'superuser', 'role' => 'Superuser', 'description' => 'With great power comes great responsibility', 'is_readonly' => 1]); $role = Role::create(['id' => 2, 'name' => 'administrator', 'role' => 'Administrator', 'description' => 'All administration will be done using this account', 'is_readonly' => 1]); }