api/laravel/Http/Resources/Json/JsonResource.yaml
2024-09-26 02:03:21 -07:00

267 lines
6.2 KiB
YAML

name: JsonResource
class_comment: null
dependencies:
- name: ArrayAccess
type: class
source: ArrayAccess
- name: Container
type: class
source: Illuminate\Container\Container
- name: UrlRoutable
type: class
source: Illuminate\Contracts\Routing\UrlRoutable
- name: Arrayable
type: class
source: Illuminate\Contracts\Support\Arrayable
- name: Responsable
type: class
source: Illuminate\Contracts\Support\Responsable
- name: JsonEncodingException
type: class
source: Illuminate\Database\Eloquent\JsonEncodingException
- name: JsonResponse
type: class
source: Illuminate\Http\JsonResponse
- name: Request
type: class
source: Illuminate\Http\Request
- name: ConditionallyLoadsAttributes
type: class
source: Illuminate\Http\Resources\ConditionallyLoadsAttributes
- name: DelegatesToResource
type: class
source: Illuminate\Http\Resources\DelegatesToResource
- name: JsonSerializable
type: class
source: JsonSerializable
properties:
- name: resource
visibility: public
comment: '# * The resource instance.
# *
# * @var mixed'
- name: with
visibility: public
comment: '# * The additional data that should be added to the top-level resource
array.
# *
# * @var array'
- name: additional
visibility: public
comment: '# * The additional meta data that should be added to the resource response.
# *
# * Added during response construction by the developer.
# *
# * @var array'
- name: wrap
visibility: public
comment: '# * The "data" wrapper that should be applied.
# *
# * @var string|null'
methods:
- name: __construct
visibility: public
parameters:
- name: resource
comment: "# * The resource instance.\n# *\n# * @var mixed\n# */\n# public $resource;\n\
# \n# /**\n# * The additional data that should be added to the top-level resource\
\ array.\n# *\n# * @var array\n# */\n# public $with = [];\n# \n# /**\n# * The\
\ additional meta data that should be added to the resource response.\n# *\n#\
\ * Added during response construction by the developer.\n# *\n# * @var array\n\
# */\n# public $additional = [];\n# \n# /**\n# * The \"data\" wrapper that should\
\ be applied.\n# *\n# * @var string|null\n# */\n# public static $wrap = 'data';\n\
# \n# /**\n# * Create a new resource instance.\n# *\n# * @param mixed $resource\n\
# * @return void"
- name: make
visibility: public
parameters:
- name: '...$parameters'
comment: '# * Create a new resource instance.
# *
# * @param mixed ...$parameters
# * @return static'
- name: collection
visibility: public
parameters:
- name: resource
comment: '# * Create a new anonymous resource collection.
# *
# * @param mixed $resource
# * @return \Illuminate\Http\Resources\Json\AnonymousResourceCollection'
- name: newCollection
visibility: protected
parameters:
- name: resource
comment: '# * Create a new resource collection instance.
# *
# * @param mixed $resource
# * @return \Illuminate\Http\Resources\Json\AnonymousResourceCollection'
- name: resolve
visibility: public
parameters:
- name: request
default: 'null'
comment: '# * Resolve the resource to an array.
# *
# * @param \Illuminate\Http\Request|null $request
# * @return array'
- name: toArray
visibility: public
parameters:
- name: request
comment: '# * Transform the resource into an array.
# *
# * @param \Illuminate\Http\Request $request
# * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable'
- name: toJson
visibility: public
parameters:
- name: options
default: '0'
comment: '# * Convert the model instance to JSON.
# *
# * @param int $options
# * @return string
# *
# * @throws \Illuminate\Database\Eloquent\JsonEncodingException'
- name: with
visibility: public
parameters:
- name: request
comment: '# * Get any additional data that should be returned with the resource
array.
# *
# * @param \Illuminate\Http\Request $request
# * @return array'
- name: additional
visibility: public
parameters:
- name: data
comment: '# * Add additional meta data to the resource response.
# *
# * @param array $data
# * @return $this'
- name: jsonOptions
visibility: public
parameters: []
comment: '# * Get the JSON serialization options that should be applied to the resource
response.
# *
# * @return int'
- name: withResponse
visibility: public
parameters:
- name: request
- name: response
comment: '# * Customize the response for a request.
# *
# * @param \Illuminate\Http\Request $request
# * @param \Illuminate\Http\JsonResponse $response
# * @return void'
- name: wrap
visibility: public
parameters:
- name: value
comment: '# * Set the string that should wrap the outer-most resource array.
# *
# * @param string $value
# * @return void'
- name: withoutWrapping
visibility: public
parameters: []
comment: '# * Disable wrapping of the outer-most resource array.
# *
# * @return void'
- name: response
visibility: public
parameters:
- name: request
default: 'null'
comment: '# * Transform the resource into an HTTP response.
# *
# * @param \Illuminate\Http\Request|null $request
# * @return \Illuminate\Http\JsonResponse'
- name: toResponse
visibility: public
parameters:
- name: request
comment: '# * Create an HTTP response that represents the object.
# *
# * @param \Illuminate\Http\Request $request
# * @return \Illuminate\Http\JsonResponse'
- name: jsonSerialize
visibility: public
parameters: []
comment: '# * Prepare the resource for JSON serialization.
# *
# * @return array'
traits:
- ArrayAccess
- Illuminate\Container\Container
- Illuminate\Contracts\Routing\UrlRoutable
- Illuminate\Contracts\Support\Arrayable
- Illuminate\Contracts\Support\Responsable
- Illuminate\Database\Eloquent\JsonEncodingException
- Illuminate\Http\JsonResponse
- Illuminate\Http\Request
- Illuminate\Http\Resources\ConditionallyLoadsAttributes
- Illuminate\Http\Resources\DelegatesToResource
- JsonSerializable
- ConditionallyLoadsAttributes
interfaces:
- ArrayAccess