use App\User; $user = User::where('email', $request->email)->first(); if ($user && password_verify($request->password, $user->password)) { // login successful } else { // login failed }
use App\User; $user = new User; $user->name = $request->name; $user->email = $request->email; $user->password = bcrypt($request->password); $user->save();
use App\User; if ($user->hasRole('admin')) { // grant access to admin-only functionality } else { // show error message or redirect to homepage }The PHP App user package library can be determined by looking at the namespace in the code examples. It is likely to be something like `Namespace\AppUser`.