K
K
ksedin2014-02-28 17:50:07
Laravel
ksedin, 2014-02-28 17:50:07

How to implement authorization in Laravel?

Can't log in, here is the code

public function createuser()
    {
        $userNickname = Input::get('username');
        $password = Input::get('password');
        $userPassword = $password;
        $side = Input::get('side');
        $user = new User;
        $user->user_nickname = "$userNickname";
        $user->password = "$userPassword";
        $user->side = "$side";
        $user->save();
        if (Auth::attempt(array('user_nickname' => $user->user_nickname, 'password' => $user->password), true)) {
            return Redirect::route('gameIndex');
        }
    }

will not be transferred to a named route, which means the user is not authorized, what is wrong in my code?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hbuser, 2014-03-05
@hbuser

Try this:
laravel.com/api/source-class-Illuminate.Auth.Guard...
In general, for the future, Laravel has an irc room. Be sure - there you will receive answers to any questions. This site is not the best place for Laravel questions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question