Files
animethemes-server/app/Http/Resources/Admin/Collection/FeaturedThemeCollection.php
T
paranarimasuandGitHub d168afd4e7 #470 feat: add featured theme model (#574)
* feat: add featured theme model

* style: fix StyleCI findings
2023-05-14 02:04:21 -05:00

39 lines
913 B
PHP

<?php
declare(strict_types=1);
namespace App\Http\Resources\Admin\Collection;
use App\Http\Resources\Admin\Resource\FeaturedThemeResource;
use App\Http\Resources\BaseCollection;
use App\Models\Admin\FeaturedTheme;
use Illuminate\Http\Request;
/**
* Class FeaturedThemeCollection.
*/
class FeaturedThemeCollection extends BaseCollection
{
/**
* The "data" wrapper that should be applied.
*
* @var string|null
*/
public static $wrap = 'featuredthemes';
/**
* Transform the resource collection into an array.
*
* @param Request $request
* @return array
*
* @noinspection PhpMissingParentCallCommonInspection
*/
public function toArray(Request $request): array
{
return $this->collection->map(
fn (FeaturedTheme $featuredTheme) => new FeaturedThemeResource($featuredTheme, $this->query)
)->all();
}
}