Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

Example on front-page #75

@byordereurope

Description

@byordereurope

Route::post('register', function() {
$rules = array(
'name' => 'required|min:3|max:80|alpha_dash',
'email' => 'required|between:3,64|email|unique:users',
'password' => 'required|alpha_num|between:4,8|confirmed',
'password_confirmation' => 'required|alpha_num|between:4,8'
);

    $validator = Validator::make(Input::all(), $rules);

    if ($validator->passes()) {
        User::create(array(
                'name'     => Input::get('name'),
                'email'    => Input::get('email'),
                'password' => Hash::make(Input::get('password'))
            ));

        return Redirect::to('/')->with('message', 'Thanks for registering!');
    } else {
        return Redirect::to('/')->withErrors($v->getMessages());
    }
}

);

It must be me missing something propably, but that withErrors is not going to return much if i look at the rest of the code ?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions