mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 02:01:33 +00:00
34 lines
665 B
PHP
34 lines
665 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\ResourceCollection;
|
|
|
|
/**
|
|
* Book Collection API Resource for transforming book collections.
|
|
*/
|
|
class BookCollection extends ResourceCollection
|
|
{
|
|
/**
|
|
* The resource that this resource collects.
|
|
*
|
|
* @var string
|
|
*/
|
|
public $collects = BookResource::class;
|
|
|
|
/**
|
|
* Transform the resource collection into an array.
|
|
*
|
|
* @return array<int|string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'data' => $this->collection,
|
|
];
|
|
}
|
|
}
|