public function destroy() { $payload = $this->getAuthToken(); $user = $this->driver->validate($payload); if (!$user) { throw new NotAuthorizedException(); } $this->driver->getProvider()->purge($user); return \Response::json(array('success' => true)); }
function filter($route, $request) { $payload = $request->header('X-Auth-Token'); if (empty($payload)) { $payload = $request->input('auth_token'); } $user = $this->driver->validate($payload); if (!$user) { throw new NotAuthorizedException(); } $this->events->fire('auth.token.valid', $user); }