public function verify(Request $request, $token = null)
{
if (is_null($token)) {
return $this->showVerifyMessage();
}
$credentials = ['email' => $request->get('email'), 'token' => $token];
$broker = $this->getBroker();
$response = Verification::broker($broker)->verify($credentials, function ($user) {
$this->verifyUser($user);
});
switch ($response) {
case Contracts\VerificationBroker::VERIFIED:
return $this->getVerificationSuccessResponse($response);
default:
return $this->getVerificationFailureResponse($request, $response);
}
}