Resolve the resource to an array.

@param  \Illuminate\Http\Request|null  $request
@return array
178957
public function resolve($request = null)
    {
        $data = $this->toArray(
            $request = $request ?: Container::getInstance()->make('request')
        );

        if ($data instanceof Arrayable) {
            $data = $data->toArray();
        } elseif ($data instanceof JsonSerializable) {
            $data = $data->jsonSerialize();
        }

        return $this->filter((array) $data);
    }
690155
protected function resolve(RequestInterface $request)
    {
        if (!$request instanceof Request) {
            return false;
        }

        /* @var $request Request */
        /* @var $uri \Zend\Uri\UriInterface */
        $uri        = $request->getUri();
        $fullPath   = $uri->getPath();
        $path       = substr($fullPath, strlen($request->getBasePath()) + 1);
        $this->path = $path;
        $asset      = $this->getResolver()->resolve($path);

        if (!$asset instanceof AssetInterface) {
            return false;
        }

        return $asset;
    }
1010618
public function path(Request $request)
		{
			$relpath = $request->get('path');
			$abspath = base_path($relpath);
			return [
				'relpath' => $relpath,
				'abspath' => $abspath,
				'exists' => file_exists($abspath)
			];
		}
1335949
public function renderAction(Request $request)
    {
        $data = (array) json_decode($request->getContent(), true);
        $menu = null;

        if (isset($data['data'])) {
            $menu = $this->getMenuFactory()->fromArray($data['data']);
        }

        return [
            'menu'    => $menu,
            'options' => isset($data['options']) ? $data['options'] : [],
        ];
    }
418421
public function indexAction(Request $request)
    {
        $configurator = $this->getAdminListConfigurator();

        /* @var AdminList $adminList */
        $adminList = $this->container->get('kunstmaan_adminlist.factory')->createList($configurator);
        $adminList->bindRequest($request);

        $cacheFresh = $this->container->get('kunstmaan_translator.service.translator.cache_validator')->isCacheFresh();
        $debugMode = $this->container->getParameter('kuma_translator.debug') === true;

        if (!$cacheFresh && !$debugMode) {
            $this->addFlash(
                FlashTypes::INFO,
                $this->container->get('translator')->trans('settings.translator.not_live_warning')
            );
        }

        return [
            'adminlist' => $adminList,
            'adminlistconfigurator' => $configurator,
        ];
    }
416422
public function resolve(): array
    {
        $path = $this->request->query->get('path');
        $method = $this->request->getMethod();

        $result = $this->match("/$path", $method);

        if (empty($result)) {
            $fallback = $this->settings->get('Melior.Routing.fallbackRoute');

            $result = [
                'target' => $this->settings->get("Melior.Routing.routes.$fallback.target"),
                'params' => [],
                'name' => $fallback
            ];
        }

        return $result;
    }
498035
public function toArray($request)
    {
        return [
            'id'           => (int) $this->id,
            'author_id'    => $this->author_id,
            'type'         => $this->whenLoaded('type', function () {
                return $this->type->name;
            }),
            'region'       => $this->region,
            'theme'        => $this->theme,
            'weight'       => $this->weight,
            'filter'       => $this->filter,
            'options'      => $this->options,
            'is_active'    => $this->is_active,
            'is_cacheable' => $this->is_cacheable,
            'created_at'   => $this->created_at->toIso8601String(),
            'updated_at'   => $this->updated_at->toIso8601String(),
            'translations' => BlockTranslation::collection($this->whenLoaded('translations')),
        ];
    }
471713
public function parse($request)
    {
        $object = clone $this->requestObject;
        $invalidValues = [];

        foreach ($this->propertyParsers as $propertyParser) {
            try {
                $this->setProperty($request, $object, $propertyParser);
            } catch (InvalidValueException $e) {
                $invalidValues[$propertyParser->getName()] = $e->getMessage();
            }
        }
        $this->checkIfRequestIsValidOrThrowException($invalidValues);

        return $object;
    }
31943
public function indexAction(Request $request)
    {
        /* @var $response \Symfony\Component\HttpFoundation\Response */
        $response = $this->get('cache_time_keeper')->getResponse([], self::CACHE_LIFETIME);
        /* @var $widget \AnimeDb\Bundle\ShikimoriWidgetBundle\Service\Widget */
        $widget = $this->get('anime_db.shikimori.widget');

        $list = $this->get('anime_db.shikimori.browser')
            ->get(str_replace('#LIMIT#', self::LIST_LIMIT, self::PATH_NEW_ITEMS));
        $list = array_slice($list, 0, self::LIST_LIMIT); // see #2

        // add Etag from list items
        $response->setEtag($widget->hash($list));

        // response was not modified for this request
        if ($response->isNotModified($request) || !$list) {
            return $response;
        }

        // build list item entities
        foreach ($list as $key => $item) {
            $list[$key] = $widget->getWidgetItem($widget->getItem($item['id']));
        }

        return $this->render(
            'AnimeDbShikimoriNewItemsWidgetBundle:Widget:index.html.twig',
            ['items' => $list],
            $response
        );
    }
747421
public function toArray($request)
    {
        return [
            'id'            => (int) $this->id,
            'author_id'     => $this->author_id,
            'language_code' => $this->language_code,
            'title'         => $this->title,
            'body'          => $this->body,
            'custom_fields' => $this->custom_fields,
            'is_active'     => $this->is_active,
            'created_at'    => $this->created_at->toIso8601String(),
            'updated_at'    => $this->updated_at->toIso8601String(),
        ];
    }
91783
public function toArray($request)
    {
        return [
            'id'           => (int) $this->id,
            'author_id'    => $this->author_id,
            'type'         => $this->whenLoaded('type', function () {
                return $this->type->name;
            }),
            'name'         => $this->name,
            'extension'    => $this->extension,
            'size'         => (int) $this->size,
            'mime_type'    => $this->mime_type,
            'info'         => $this->info,
            'thumb'        => $this->whenLoaded('type', function () {
                if ($this->type->name === 'image') {
                    $width  = config('gzero.image.thumb.width');
                    $height = config('gzero.image.thumb.height');
                    return croppaUrl($this->getFullPath(), $width, $height);
                }

                return null;
            }),
            'weight'       => $this->whenPivotLoaded('uploadables', function () {
                return $this->pivot->weight;
            }),
            'is_active'    => $this->is_active,
            'created_at'   => $this->created_at->toIso8601String(),
            'updated_at'   => $this->updated_at->toIso8601String(),
            'translations' => FileTranslation::collection($this->whenLoaded('translations')),
        ];
    }
277690
public function HandleRequest($request)
    {
        if ($this->typesInfos()->contains('image')) {
            $name = $this->type->search('image');
            if ($request[$name]) {
                $image = $this->upload($request[$name]);
                $request[$name] = $image;
            }
        }

        if ($this->typesInfos()->contains('select_multiple')) {
            $name = $this->type->search('select_multiple');
            if ($request[$name]) {
                $request[$name] = json_encode($request[$name]);
            }
        }
        return $request;
    }
271942
public function toArray($request)
    {
        /** @var \Unite\Transactions\Models\Source $this->resource */
        return [
            'id'                => $this->id,
            'type'              => $this->type,
            'balance'           => $this->balance,
            'is_bank_account'   => $this->isBankAccount(),
            'name'              => $this->name,
            'short_name'        => $this->short_name,
            'iban'              => $this->iban,
            'bic'               => $this->bic,
            'swift'             => $this->swift,
            'description'       => $this->description,
            'created_at'        => (string)$this->created_at,
        ];
    }
550518
private function getUriContext(Request $request): array
    {
        $context = $request->query->get('ngbmContext');
        $context = is_array($context) ? $context : [];

        if (!$this->uriSigner->check($this->getUri($request))) {
            return [];
        }

        return $context;
    }
911823
public function getMapping(Request $request): array
    {
        return $this->cache->load($this->getCacheKey($request), function (&$dependencies) use ($request) {
            return $this->loadMapping($request->getPresenterName(), $request->getParameters(), $dependencies);
        });
    }
561800
public function filter($request): array
    {
        if (\is_array($request)) {
            return $request;
        } elseif ($request === '*') {
            return $this->get();
        } elseif ($request[0] === '!') {
            return \array_diff($this->get(), [\substr($request, 1)]);
        }

        return [$request];
    }
142541
public function resolve()
    {
        $request = $this->process->getContext()->getRequest();
        $hasSession = $request->getSession() !== null;
        $this->data = [
            'method' => $request->getMethod(),
            'real-method' => $request->getRealMethod(),
            'uri' => $request->getUri(),
            'scriptName' => $request->getScriptName(),
            'port' => $request->getPort(),
            'ssl' => $request->isSecure(),
            'scheme' => $request->getScheme(),
            'accept-content-types' => $request->getAcceptableContentTypes(),
            'cookies' => $request->cookies->all(),
            'headers' => $request->headers->all(),
            'data' => [
                'get' => $request->query->all(),
                'post' => $request->request->all()
            ],
            'charsets' => $request->getCharsets(),
            'default-local' => $request->getDefaultLocale(),
            'local' => $request->getLocale(),
            'encodings' => $request->getEncodings(),
            'etags' => $request->getETags(),
            'session' => [
                'id' => $hasSession ? $request->getSession()->getId() : null,
                'data' => $hasSession ? $request->getSession()->all() : []
            ]
        ];
    }