/**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $roleAdmin = Role::where('name', Role::ROLE_ADMIN)->first();
     $admin = User::create(['name' => 'Administrator', 'email' => '*****@*****.**', 'password' => bcrypt(123456)]);
     $admin->roles()->save($roleAdmin);
 }
Example #2
0
 public function test_can_restore_rows_from_deleted()
 {
     $user = User::create(['name' => 'User Test', 'email' => '*****@*****.**', 'password' => '123456']);
     $user->delete();
     $user->restore();
     $user = User::find(1);
     $this->assertEquals(1, $user->id);
     $this->assertEquals('User Test', $user->name);
 }
Example #3
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array $data
  * @return User
  */
 protected function create(array $data)
 {
     return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
 }