mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-09-09 14:13:15 +02:00
* feat(admin): migrate db dumps from github to platform * style: fix StyleCI findings
39 lines
824 B
PHP
39 lines
824 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Resources\Admin\Collection;
|
|
|
|
use App\Http\Resources\Admin\Resource\DumpResource;
|
|
use App\Http\Resources\BaseCollection;
|
|
use App\Models\Admin\Dump;
|
|
use Illuminate\Http\Request;
|
|
|
|
/**
|
|
* Class DumpCollection.
|
|
*/
|
|
class DumpCollection extends BaseCollection
|
|
{
|
|
/**
|
|
* The "data" wrapper that should be applied.
|
|
*
|
|
* @var string|null
|
|
*/
|
|
public static $wrap = 'dumps';
|
|
|
|
/**
|
|
* Transform the resource collection into an array.
|
|
*
|
|
* @param Request $request
|
|
* @return array
|
|
*
|
|
* @noinspection PhpMissingParentCallCommonInspection
|
|
*/
|
|
public function toArray($request): array
|
|
{
|
|
return $this->collection->map(
|
|
fn (Dump $dump) => new DumpResource($dump, $this->query)
|
|
)->all();
|
|
}
|
|
}
|