Files
animethemes-server/app/Http/Resources/Wiki/Video/Collection/ScriptCollection.php
T
paranarimasu 8b6b196c99 feat(admin): migrate db dumps from github to platform (#465)
* feat: migrate encoding scripts from github to platform

* style: fix StyleCI finding

* fix: don't concatenate updated videos when attempting to attach entry on video upload

* fix(api): fix field dependencies & feat(admin): upload script from video detail screen
2022-09-24 00:01:37 -05:00

37 lines
843 B
PHP

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