Answers for "role acces login in laravel"

PHP
0

role acces login in laravel

public function authenticate(Request $request)
    {
        $request->validate([
            'email' => 'required|string|email',
            'password' => 'required|string',
        ]);

        $credentials = $request->only('email', 'password');

        if (Auth::attempt($credentials)) {
           
                return redirect('/');
            }          
            return redirect('login')->with('error', 'Opps! You have entered invalid credentials');   
              
    }
Posted by: Guest on May-04-2021

Browse Popular Code Answers by Language