Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Hello im working with laravel 4 in a proyect and it´s not the first time but i have a problem that ive never had before.

Some mandatory parameters are missing ("key") to generate a URL for route "register".

I dont know how to fix it i've tryed everything i came up with but no results. These are my routes:

Route::get('register/{key}',array('before'=>'guest','as'=>'register','uses' => 'UserController@create'));
Route::post('register/{key}',array('before'=>'csrf','uses'=>'UserController@store'));

And my controller: class UserController extends BaseController {

public function getRegistro($key = null)
{
    $invites = Invite::lists('key');
    if (in_array($key, $invites)) {
        return View::make('home.register')
        ->with('title','Register')
        ->with('key',$key);
    }else{
         Notification::error('Not a valid key to register.');
        return Redirect::route('home');
    }
}

public function postStore()
{
    $validator = Validator::make(
        array(
            'username' => Input::get('username'),
            'password'=>Input::get('password'),
            'password_confirmation'=>Input::get('password_confirmation'),
            'email'=>Input::get('email'),
            'ubi'=>Input::get('ubi'),
            'bio'=>Input::get('bio'),
        ),
        array(
            'username' => 'required|unique:users|',
            'password'=> 'required|min:6|confirmed',
            'password_confirmation'=> 'required|min:6',
            'email'=> 'required|unique:users|email',
            'ubi'=> 'required|min:5',
            'bio'=>'required|min:10',
        )
    );
    if ($validator->fails())
    {
        Notification::error($validator->messages());
        return Redirect::route('register');
    }else{
        $user = new User;

        $user->username = Input::get( 'username' );
        $user->email = Input::get( 'email' );
        $user->password = Input::get( 'password' );
        $user->save();
    }

That problem happens when i send an empty form but when i put info for example my username as Bruce i get this error:

Method [validateBruce] does not exist.

Please help

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.