Transform the resource into an array.

@param  \Illuminate\Http\Request $request request

@return array
490788
public function toArray($request)
    {
        return [
            'id'              => (int) $this->id,
            'author_id'       => $this->author_id,
            'language_code'   => $this->language_code,
            'title'           => $this->title,
            'teaser'          => $this->teaser,
            'body'            => $this->body,
            'seo_title'       => $this->seo_title,
            'seo_description' => $this->seo_description,
            'is_active'       => $this->is_active,
            'created_at'      => dateTimeToRequestTimezone($this->created_at)->toIso8601String(),
            'updated_at'      => dateTimeToRequestTimezone($this->updated_at)->toIso8601String(),
        ];
    }
540401
public function get_items( $request ) {
		$data = array();
		$statuses = get_post_stati( array( 'internal' => false ), 'object' );
		$statuses['trash'] = get_post_status_object( 'trash' );
		foreach ( $statuses as $slug => $obj ) {
			$ret = $this->check_read_permission( $obj );
			if ( ! $ret ) {
				continue;
			}
			$status = $this->prepare_item_for_response( $obj, $request );
			$data[ $obj->name ] = $this->prepare_response_for_collection( $status );
		}
		return rest_ensure_response( $data );
	}
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;
    }
889881
private function getContentFromRequest(Request $request): array
    {
        $data = json_decode($request->getContent(), true);
        foreach ($data as $key => $value) {
            if ($value === null || $value === '') {
                unset($data[$key]);
            }
        }
        return $data;
    }
260900
private function parseData($request)
    {
        $role     = $request->user()->role_id;
        $route    = explode('.', $request->route()->getName());
        $official = [
            'menu',
            'users',
            'roles',
            'actions'
        ];
        if (in_array($route[0], $official)) {
            return [$role, config('quickadmin.defaultRole')];
        } else {
            $menuName = $route[1];
        }
        $menu = Menu::where('name', ucfirst($menuName))->firstOrFail();

        return [$role, $menu];
    }
173170
public function newAction(Request $request)
    {
        $entity = new Episode();
        $form   = $this->createCreateForm($entity);

        return [
            'entity' => $entity,
            'form'   => $form->createView(),
        ];
    }
921050
protected function parseRequestServer($request)
    {
        $server = [];

        foreach (($request->server ?? []) as $name => $value) {
            $server[strtoupper($name)] = $value;
        }

        foreach (($request->header ?? []) as $name => $value) {
            $server['HTTP_'.strtoupper($name)] = $value;
        }

        return $server;
    }
714582
public function toArray($request)
    {
        return [
            'id' => $this->id,
            'name' => $this->name,
            'identifier' => $this->identifier,
            'data_type' => $this->data_type,
            'field_type' => $this->field_type,
            'sort_order' => $this->sort_order,
            'dropdown_options' => $this->when($this->field_type == 'SELECT', new PropertyDropdownOptionCollectionResource($this->propertyDropdownOptions)),
            'use_for_all_products' => $this->use_for_all_products,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
        ];
    }
161772
final protected function getRequestParameters($request) {
		$parameters = $request->route()->parameters;
		array_unshift($parameters, $request);
		
		return $parameters;
	}
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'] : [],
        ];
    }
994353
public function fields(Request $request)
    {
        return array_merge([
            Sortable::make('Sort', 'id'),
            MorphTo::make('Repeatable')->types(array_wrap(static::getMorphToArray()))->onlyOnDetail(),
            Text::make('Name'),
            Polymorphic::make('Type')->types($request, $this->types($request))->hideTypeWhenUpdating(),
            $this->morphRepeaters($request),
        ], $this->extraInfo($request));
    }
845392
protected function paginationInformation($request)
    {
        $paginated = $this->resource->resource->toArray();

        return [
            'links' => $this->paginationLinks($paginated),
            'meta' => $this->meta($paginated),
        ];
    }
1125512
public function getConfiguration(Request $request)
    {
        $this->request = $request;

        return [
            'base_uri' => $request->getOptions()->get('base_url'),
            'headers'  => $request->getHeaders()->all(),
            'query'    => $request->getParameters()->all()
        ];
    }
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,
        ];
    }
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')),
        ];
    }
595846
public function parse($request)
    {
        try {
            $parameters = Json::decode($request->getBody()->__toString(), $this->asArray);
            return $parameters === null ? [] : $parameters;
        } catch (InvalidArgumentException $e) {
            if ($this->throwException) {
                throw new BadRequestHttpException('Invalid JSON data in request body: ' . $e->getMessage());
            }

            return [];
        }
    }
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);
        });
    }