middleware('guest'); } public function activate($token) { /** @var User $user */ $user = User::where(['is_activated' => false, 'activation_token' => $token])->first(); if (is_null($user)) { App::abort(404); return null; } $user->is_activated = true; $user->activation_token = null; $user->save(); return redirect($this->redirectPath()); } }