Свойство | Type | Description | |
---|---|---|---|
$manager | League\Fractal\Manager | The manager responsible for transforming and serializing data. | |
$meta | array | The meta data appended to the serialized data. | |
$relations | array | The included relations. | |
$resource | League\Fractal\Resource\ResourceInterface | The Fractal resource instance containing the data and transformer. | |
$resourceFactory | The resource factory used to generate resource instances. | ||
$statusCode | integer | The HTTP status code for the response. |
Méthode | Description | |
---|---|---|
__construct ( Illuminate\Contracts\Routing\ResponseFactory | |
SuccessResponseBuilder constructor. | |
addMeta ( array $data ) : |
Add data to the meta data appended to the response data. | |
getManager ( ) : League\Fractal\Manager | Get the Fractal manager responsible for transforming and serializing the data. | |
getResource ( ) : League\Fractal\Resource\ResourceInterface | Get the Fractal resource instance. | |
include ( array | string $relations ) : |
Set the serializer used to serialize the resource data. | |
serializer ( League\Fractal\Serializer\SerializerAbstract | string $serializer ) : |
Set the serializer used to serialize the resource data. | |
setStatus ( integer $statusCode ) : |
Set the HTTP status code for the response. | |
toArray ( ) : array | Convert the response to an array. | |
transform ( mixed | null $data = null, callable | string | null $transformer = null, string $resourceKey = null ) : |
Set the transformation data. This will set a new resource instance on the response builder depending on what type of data is provided. |
Méthode | Description | |
---|---|---|
parseTransformer ( |
Parse a transformer class and set relations. | |
resolveModel ( |
Resolve a model instance from the data. | |
resolveNestedRelations ( |
Resolve eager loaded relations from the model including any nested relations. | |
resolveRelations ( |
Resolve eager loaded relations from the model. | |
resolveResourceKey ( |
Resolve the resource key from the model. | |
resolveSerializer ( League\Fractal\Serializer\SerializerAbstract | string $serializer ) : League\Fractal\Serializer\SerializerAbstract | Resolve a serializer instance from the value. | |
resolveTransformer ( |
Resolve a transformer. | |
resolveTransformerFromModel ( |
Resolve a transformer from the model. If the model is not transformable, a closure based transformer will be created instead, from the model's fillable attributes. | |
serialize ( League\Fractal\Resource\ResourceInterface $resource ) : array | Serialize the transformation data. |
public __construct ( Illuminate\Contracts\Routing\ResponseFactory | |
||
$responseFactory | Illuminate\Contracts\Routing\ResponseFactory | |
|
$resourceFactory | ||
$manager | League\Fractal\Manager |
public getManager ( ) : League\Fractal\Manager | ||
Résultat | League\Fractal\Manager |
public getResource ( ) : League\Fractal\Resource\ResourceInterface | ||
Résultat | League\Fractal\Resource\ResourceInterface |
protected parseTransformer ( |
||
$transformer | ||
$model | ||
Résultat |
protected resolveModel ( |
||
$data | ||
Résultat |
protected resolveNestedRelations ( |
||
$data | ||
Résultat | array |
protected resolveRelations ( |
||
$model | ||
Résultat | array |
protected resolveResourceKey ( |
||
$model | ||
$resourceKey | string | |
Résultat | string |
protected resolveSerializer ( League\Fractal\Serializer\SerializerAbstract | string $serializer ) : League\Fractal\Serializer\SerializerAbstract | ||
$serializer | League\Fractal\Serializer\SerializerAbstract | string | |
Résultat | League\Fractal\Serializer\SerializerAbstract |
protected resolveTransformerFromModel ( |
||
$model | ||
Résultat |
public serializer ( League\Fractal\Serializer\SerializerAbstract | string $serializer ) : |
||
$serializer | League\Fractal\Serializer\SerializerAbstract | string | |
Résultat |
protected Manager,League\Fractal $manager | ||
Résultat | League\Fractal\Manager |
protected array $meta | ||
Résultat | array |
protected ResourceInterface,League\Fractal\Resource $resource | ||
Résultat | League\Fractal\Resource\ResourceInterface |
protected ResourceFactory,Flugg\Responder $resourceFactory | ||
Résultat |
protected int $statusCode | ||
Résultat | integer |