Exemplo n.º 1
0
 public static function NewUser($request)
 {
     $user = new self();
     $user->name = $request['name'];
     $user->email = $request['email'];
     $user->password = bcrypt($request['password']);
     $user->save();
     \DB::insert("INSERT INTO roles VALUES({$user->id}, 2)");
     Session::flash('sm', 'Welcome ' . $request['name'] . '! now you can sign in with your account');
 }