PHP Class EllipseSynergie\ApiResponse\Laravel\Response

For the full copyright and license information, please view the LICENSE file that was distributed with this source code.
Author: Maxime Beaudoin ([email protected])
Inheritance: extends EllipseSynergie\ApiResponse\AbstractResponse
ファイルを表示 Open project: ellipsesynergie/api-response Class Usage Examples

Public Methods

Method Description
errorWrongArgsValidator ( Illuminate\Contracts\Validation\Validator $validator ) : Illuminate\Contracts\Routing\ResponseFactory Generates a Response with a 400 HTTP header and a given message from validator
withArray ( array $array, array $headers = [] ) : Illuminate\Contracts\Routing\ResponseFactory
withPaginator ( Illuminate\Contracts\Pagination\LengthAwarePaginator $paginator, callable | League\Fractal\TransformerAbstract $transformer, string $resourceKey = null, array $meta = [] ) : Illuminate\Contracts\Routing\ResponseFactory Respond with a paginator, and a transformer.

Method Details

errorWrongArgsValidator() public method

Generates a Response with a 400 HTTP header and a given message from validator
public errorWrongArgsValidator ( Illuminate\Contracts\Validation\Validator $validator ) : Illuminate\Contracts\Routing\ResponseFactory
$validator Illuminate\Contracts\Validation\Validator
return Illuminate\Contracts\Routing\ResponseFactory

withArray() public method

public withArray ( array $array, array $headers = [] ) : Illuminate\Contracts\Routing\ResponseFactory
$array array
$headers array
return Illuminate\Contracts\Routing\ResponseFactory

withPaginator() public method

Respond with a paginator, and a transformer.
public withPaginator ( Illuminate\Contracts\Pagination\LengthAwarePaginator $paginator, callable | League\Fractal\TransformerAbstract $transformer, string $resourceKey = null, array $meta = [] ) : Illuminate\Contracts\Routing\ResponseFactory
$paginator Illuminate\Contracts\Pagination\LengthAwarePaginator
$transformer callable | League\Fractal\TransformerAbstract
$resourceKey string
$meta array
return Illuminate\Contracts\Routing\ResponseFactory