Esempio n. 1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $user = new \App\Models\User();
     $user->email = "*****@*****.**";
     $user->password = \Hash::make("admin");
     $user->save();
     $role = \App\Models\Role::where("key", "=", "admin")->first();
     $user->roles()->attach($role->id);
 }
Esempio n. 2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('users')->delete();
     $user = new \App\Models\User();
     $user->email = "*****@*****.**";
     $user->username = "******";
     $user->password = \Hash::make("admin");
     $user->save();
     $user->roles()->save(Role::where("key", "=", "admin")->first());
 }