D
D
deadmemoras2016-08-18 07:03:54
Laravel
deadmemoras, 2016-08-18 07:03:54

No laravel errors?

I have my UserController class, inherited from the base one (obviously).
Registered validate in the UserController class

public function postSignUp(Request $request)
{
    $this->validate($request, [
        'email' => 'required|email|unique:users',
        'first_name' => 'required|max:120',
        'password' => 'required|min:4'
    ]);

    $email = $request['email'];
    $first_name = $request['first_name'];
    $password = bcrypt($request['password']);

    $user = new User();
    $user->email = $email;
    $user->first_name = $first_name;
    $user->password = $password;

    $user->save();

    Auth::login($user);

    return redirect()->route('dashboard');
}

Blade(welcome.blade.php - Main page)
<div class="alert alert-danger">
    <ul>
        @foreach ($errors->all() as $error)
            <li>{{ $error }}</li>
        @endforeach
    </ul>
</div>

And routes
Route::get('/', function () {
    return view('welcome');
});


Route::group(['middleware' => ['web']], function ()
{
    Route::post('/signup', ['uses' => '[email protected]', 'as' => 'signup']);
    Route::post('/signin', ['uses' => '[email protected]', 'as' => 'signin']);
    Route::get('/dashboard', ['uses' => '[email protected]', 'as' => 'dashboard']);
});

But for some reason it doesn't throw an error.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
deadmemoras, 2016-08-18
@deadmemoras

Solution:
Move both signin and signup routers to 'middleware'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question