Answer the question
In order to leave comments, you need to log in
How to properly validate an invite when registering a user?
There is a registration controller with a method:
public function register(Request $request)
{
$this->validator($request->all())->validate();
$invite_avaible = \App\Invite::isAvailable($request->input('invite'););
if ($invite_avaible) {
$user = $this->create($request->all());
}
return $this->registered($request, $user)
?: redirect($this->redirectPath())->with('success', 'We have sent an activation link on your email id. Please verify your account.');
}
$invite_avaible = \App\Invite::isAvailable($request->input('invite'));
Answer the question
In order to leave comments, you need to log in
it would be convenient to do this in the Validator, but as far as I understand, it is not very flexible in its configuration.
Illuminate\Contracts\Validation\Rule
, Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question