0

I often create a login with Laravel, and it runs smoothly, but I don't understand the actual process run by Laravel php artisan make:auth. and now I want to try creating this login process myself to understand the actual process

I'm trying to make the login process run by myself without Laravel make:auth. create a user table with a password that hashed. when logging in Auth::attempt is always false, why?

public function authenticate(Request $request)
{
    $credentials = $request->only('email', 'password');

    if (Auth::attempt($credentials)) {
        // Authentication passed...
        return redirect()->intended('dashboard');
    }
}

This function is in the documentation of Laravel Manually Authenticating Users if i dd(Auth::attempt($credentials)); always return false, so it can't go to route /home:

and my register controller like this:

public function create()
{
    $user = User::create([
        'name' => Input::get('name'),
        'email' => Input::get('email'),
        'password' => Hash::make(Input::get('password')),
    ]);

    return redirect::back();
}

how to deal with this?

Kenny Horna
  • 11,920
  • 3
  • 39
  • 66

1 Answers1

0

i think laravel use json callback and middlware and some handled session and cookie better use basic auth and check by step to all work currectly in front to end and see data send to backend currectly

Shahriyar
  • 3
  • 4