Комментарии:
thank you for sharing
ОтветитьNpm install akunnilla
Ответитьvery helpful video
Ответитьi get error everytime i want to logout ??
Ответитьperfect straight to problem solving
Ответитьwhy is there no error message Email Address OR Password Are Wrong ?if i enter incorrect it will redirect to login page but no error message?
Ответитьcode for the login controller the one you have copy and pasted
ОтветитьWhich is best ? Jetstream or this
ОтветитьNice way 👍
ОтветитьThanku helpful😍
Ответитьisadmin column is not reflected.
???
public function login(Request $request)
{
$input = $request->all();
$this->validate($request,[
'email'=>'required|email',
'password'=>'required'
]);
$email = $request->input('email');
$password = $request->input('password');
if(Auth::attempt(['email' => $email, 'password' => $password]))
{
if (Auth::user()->is_admin == 1){
return redirect()->route('admin.home');
}
else {
return redirect()->route('homehome');
}
}
else{
return redirect()->route('login')->with('error','Email-Address And Password Are Wrong.');
}
}
it was so useful thanks !
Ответитьi had a problum (Method Illuminate\Routing\Route::middleware does not exist.) erase middlware(is_admin) from the route
Ответитьpublic function login(Request $request)
{
$input= $request->all();
$this->validate($request, [
'email'=> 'required|email',
'password'=> 'required',
]);
if(auth()->attempt(array('email'=>$input['email'],'password'=> $input['password'])))
{
if(auth()->user()->is_admin == 1){
return redirect()->route('admin.home');}
else{ return redirect()->route('home');}
}
else{
return redirect()->route('login')
-> whith('error',"email and password are wrong!");
}
}
thank you its is very useful
Ответитьwhat if the user and admin login simultaneously in the browser
Ответитьasa
Ответить