handle the request

@return Response
@throws HttpForbiddenException
14885
public function handler(): Response
    {
        $mailer = Mailer::find($this->getParameter('id'));
        if (!$mailer) {
            throw new HttpForbiddenException();
        }
        foreach (Mailer::all() as $m) {
            $m->default(false)->save();
        }
        $mailer->default(true)->save();
        $this->log('info', 'Set mailer [' . $mailer->getSender() . '] as default');
        return response();
    }
1253926
public function handleRequest()
    {
        try {
            $this->response = parent::handleRequest();
        } catch (HttpException $ex) {
            $this->config->set('page_title', 'Error');

            $view = new View('exception');
            $view->exception = $ex;

            $this->response->setResponseCode($ex->getErrorCode());
            $this->response->setContent($view->render());
        } catch (\Exception $ex) {
            $this->config->set('page_title', 'Error');

            $view = new View('exception');
            $view->exception = $ex;

            $this->response->setResponseCode(500);
            $this->response->setContent($view->render());
        }

        if ($this->response->hasLayout() && $this->controller->layout) {
            $this->setLayoutVariables($this->controller->layout);

            $this->controller->layout->content  = $this->response->getContent();
            $this->response->setContent($this->controller->layout->render());
        }

        return $this->response;
    }
457099
public function handler(): Response
    {
        $bulletin = Bulletin::find($this->getParameter('id'));
        if (!$bulletin) {
            throw new HttpNotFoundException();
        }
        return response([
            'id' => $bulletin->getId(),
            'createdAt' => $bulletin->getCreatedAt()->getTimestamp(),
            'updatedAt' => ($bulletin->getUpdatedAt() ?? $bulletin->getCreatedAt())->getTimestamp(),
            'title' => $bulletin->getTitle(),
            'content' => $bulletin->getContent(),
            'isDraft' => $bulletin->isDraft(),
            'receivers' => $bulletin->getReceivers(),
            'statistics' => $bulletin->getStatistics()
        ]);
    }
274632
public function handler(): Response
    {
        $bulletin = Bulletin::find($this->getParameter('id'));
        if (!$bulletin) {
            throw new HttpNotFoundException();
        }
        if ($bulletin->isDraft()) {
            $bulletin->publish();
            $this->log('info', 'Publish a bulletin [' . $bulletin->getId() . ']');
        } else {
            throw new HttpForbiddenException();
        }
        return response();
    }
49238
public function handler(): Response
    {
        $role = Role::find($this->getParameter('id'));
        if (!$role) {
            throw new HttpForbiddenException();
        }
        $this->log('info', 'Delete role [' . $role->getSlug() . ']');
        $role->delete(true);
        return response();
    }
306642
public function handle()
    {
        parent::handle();

        $controllerGenerator = new APIRequestGenerator($this->commandData);
        $controllerGenerator->generate();

        $this->performPostActions();
    }
1253107
public function handler(): Response
    {
        $data = $this->validate([
            'role' => []
        ]);
        $member = Member::search($this->getParameter('username'));
        if (!$member) {
            throw new HttpNotFoundException();
        }
        $data['role'] = Role::findBy(['slug' => $data['role']]);
        if (!$data['role']) {
            throw new HttpForbiddenException();
        }
        $member->update($data);
        $this->log('info', 'Update member [' . $member->getUsername() . ']\'s role to [' . $data['role']->getSlug() . ']');
        return response();
    }
1293006
public function handle()
    {
        chdir(public_path());

        $this->line("<info>Laravel development server started:</info> <http://{$this->host()}:{$this->port()}>");

        passthru($this->serverCommand(), $status);

        if ($status && $this->canTryAnotherPort()) {
            $this->portOffset += 1;

            return $this->handle();
        }

        return $status;
    }
490304
public function execute()
    {
        $ch = curl_init();
        $this->setAuth($ch);
        try {
            switch (strtoupper($this->verb)) {
                case 'GET':
                    $this->executeGet($ch);
                    break;
                case 'POST':
                    $this->executePost($ch);
                    break;
                case 'PUT':
                    $this->executePut($ch);
                    break;
                case 'DELETE':
                    $this->executeDelete($ch);
                    break;
                default:
                    throw new \InvalidArgumentException(
                        'Current verb (' . $this->verb
                        . ') is an invalid REST verb.'
                    );
            }
        } catch (\InvalidArgumentException $e) {
            curl_close($ch);
            throw $e;
        } catch (\Exception $e) {
            curl_close($ch);
            throw $e;
        }

        /*
         * check and debug api request total time
         */
        $this->processDebugApi();

        return $this->responseBody;
    }
484998
public function handle()
    {
        try {
            $event = new BeforeProxyEvent($this->proxy_query);
            $this->event_dispatcher->dispatch('owsproxy.before_proxy', $event);
        } catch (\RuntimeException $e) {
            throw new HTTPStatus502Exception();
        }

        $browserResponse = parent::handle();

        if ($browserResponse->isOk()) {
            $event = new AfterProxyEvent($this->proxy_query, $browserResponse);
            $this->event_dispatcher->dispatch('owsproxy.after_proxy', $event);
        } else {
            // pass auth challenge down to client, but alter realm to make it
            // unique as it will be applied to this server as the auth
            // partition key!
            if (401 === $browserResponse->getStatusCode()) {
                $headers = $browserResponse->getHeaders();
                $needle = 'www-authenticate: basic realm="';
                foreach ($headers as $idx => &$header) {
                    $haystack = strtolower($header);
                    if (0 === strpos($haystack, $needle)) {
                        $origRealm = substr($header, strlen($needle), strlen($header) - strlen($needle) - 1);
                        $rawUrl = $this->proxy_query->getRowUrl(); // ;)

                        $scheme = empty($rawUrl["scheme"]) ? "http://" : $rawUrl["scheme"] . "://";
                        $host = $rawUrl["host"];
                        $port = empty($rawUrl["port"]) ? "" : ":" . $rawUrl["port"];
                        $path = empty($rawUrl["path"]) ? "" : $rawUrl["path"];
                        $server = $scheme . $host . $port . $path;
                        $realm = 'Server: ' . $server . ' - ' . $origRealm;
                        $header = 'WWW-Authenticate: Basic realm="' . $realm . '"';

                        $browserResponse->setHeaders($headers);
                        break;
                    }
                }
                return $browserResponse;
            }
            $message = null;
            if ($browserResponse->getReasonPhrase() !== null) {
                $rawUrl = $this->proxy_query->getRowUrl();
                $message = 'Server "' . $rawUrl['host'] . '" says: ' . $browserResponse->getReasonPhrase();
                throw new HTTPStatus502Exception($message);
            } else {
                throw new HTTPStatus502Exception();
            }
        }
        return $browserResponse;
    }
80997
public function handle()
    {
        switch (strtolower($_SERVER['QUERY_STRING'])){
        case 'wsdl':
            $this->intoStruct();
            $this->handleWSDL();
            break;
        case 'disco':
            $this->intoStruct();
            $this->handleDISCO();
            break;
        default:
            $this->intoStruct();
            if (isset($_SERVER['HTTP_SOAPACTION'])) {
                $this->createServer();
            } elseif (isset($_REQUEST['svc'])) {
               	$this->handleHTTP(); // by JG
            } else {
                $this->handleINFO();
            }
            break;
        }
    }
1295084
private function handle(){
        $params = [
            "start"     => null,
            "finish"    => null,
            "response"  => null,
            "error"     => null,
        ];

        try{
            $params["start"]    = microtime(true);
            $params["response"] = $this->handler->handle($this->request);
        }catch(\Throwable $e){
            $params["error"]    = $e;
            $this->error        = $e;
        }finally{
            $params["finish"]   = microtime(true);
        }

        $this->event(new Event("response.handle.after", $params));

        return $params["response"];
    }
798572
public function handle()
    {
        $id = $this->getAttribute('id');
        Event::fire('antares.ready: menu.before.' . $id);
        Event::fire(new BeforeMenu($id, $this));


        if (!$this->passesAuthorization()) {
            return;
        }
        $args = func_get_args();


        if (isset($args[0]) && ($args[0] instanceof AfterMenu || $args[0] instanceof Handler)) {
            $menu = $args[0] instanceof AfterMenu ? $args[0]->menu : $args[0];

            $menu->add($this->getAttribute('id'))
                    ->link($this->getAttribute('link'))
                    ->title($this->getAttribute('title'))
                    ->icon($this->getAttribute('icon'))
                    ->type($this->getAttribute('type'))
                    ->active($this->getAttribute('active'));
        } else {
            $menu = $this->createMenu();
            if ($menu) {
                $this->attachIcon($menu);
            }
        }

        Event::fire('antares.ready: menu.after.' . $id);
        Event::fire(new AfterMenu($id, $this));
    }
289936
public function handler(): Response
    {
        $response = [];
        foreach (Permission::all() as $permission) {
            $response[] = [
                'id' => $permission->getId(),
                'permission' => $permission->getPermission(),
                'role' => [
                    'id' => $permission->getRole()->getId(),
                    'name' => $permission->getRole()->getName(),
                    'slug' => $permission->getRole()->getSlug()
                ]
            ];
        }
        return response($response);
    }
88516
public function send()
    {
        try {
            $response = $this->guzzleClient->request($this->method, $this->uri, $this->options);
        } catch (ClientException $e) {
            $this->handleApiException($e->getResponse()->getBody()->getContents());
        }

        return $this->getBody($response);
    }
383788
public function handle()
    {
        if (empty($this->attributes['name'])) { // handle empty nickname users
            $this->attributes['name'] = $this->buildUniqueNickname();
        }
        $user = $this->dbTransaction(function () {
            if (array_key_exists('password', $this->attributes)) {
                $this->attributes['password'] = bcrypt($this->attributes['password']);
            }
            $user = new User();
            $user->fill($this->attributes);
            $user->save();

            event('user.created', [$user]);
            return $user;
        });
        return $user;
    }
1058375
public function handler(): Response
    {
        $data = $this->validate([
            'email' => [
                new Email()
            ],
            'phone' => []
        ]);
        $member = Member::search($this->getParameter('username'));
        if (!$member) {
            throw new HttpNotFoundException();
        }
        $member->update($data);
        $this->log('info', 'Update member [' . $member->getUsername() . ']');
        return response();
    }