#Auth

2 messages · Page 1 of 1 (latest)

shut minnow
#

Hello, I use the Auth::login() function to authorize the user, but a user is also created in the database. How could I do it, so that the user is not created, and is only set in the cache/file? Is it because of the created model connected with migration?

        $user = new User([
            'username' => $request->username,
            'password' => bcrypt($request->password)
        ]);

        if (Auth::attempt(['username' => $request->username, 'password' => $request->password])) {
            return redirect()->route("welcome");
        } else {
            Auth::login($user, true);
        }

        if(Auth::check()) {
            return redirect()->route("welcome");
        }
    }```
#

I don't use breeze as authentication, only the Auth class