Laravel registration email approve

Wednesday, November 4, 2015

Okay so i got script based on laravel framework:



    public function confirm($activationCode)
{
if( ! $activationCode)
{
throw new InvalidActivationCodeException;
}

$user = User::whereActivationCode($activationCode)->first();

if ( ! $user)
{
throw new InvalidActivationCodeException;
}

$user->activated = 1;
$user->activation_code = null;
$user->save();

return Redirect::route('login_path');
}


}



He's checking database cell activation_code. My route.php looks like that:



ModuleRoute::controller('auth/registration/approve/{activationCode}', 'RegistrationController@confirm');


But then i go to the link: http://default.com/auth/registration/approve/some activation id/ i got error: Controller method not found.



What's the problem?

0 comments:

Post a Comment