mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
- AppServiceProvider is needs more work to wire in new services - todo: more dtos - todo: add unit tests - todo: add more integration tests
43 lines
903 B
PHP
43 lines
903 B
PHP
<?php
|
|
|
|
|
|
namespace App\Http\Resources\V4;
|
|
|
|
use Illuminate\Http\Resources\Json\ResourceCollection;
|
|
|
|
class GenreCollection extends ResourceCollection
|
|
{
|
|
|
|
/**
|
|
* The resource that this resource collects.
|
|
*
|
|
* @var string
|
|
*/
|
|
public $collects = 'App\Http\Resources\V4\GenreResource';
|
|
|
|
/**
|
|
* Transform the resource collection into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return array
|
|
*
|
|
* @OA\Schema(
|
|
* schema="genres",
|
|
* description="Genres Collection Resource",
|
|
*
|
|
* @OA\Property(
|
|
* property="data",
|
|
* type="array",
|
|
* @OA\Items(
|
|
* type="object",
|
|
* ref="#/components/schemas/genre"
|
|
* ),
|
|
* ),
|
|
* )
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return $this->collection;
|
|
}
|
|
}
|