mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-25 00:04:33 +02:00
* 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
64 lines
1.4 KiB
PHP
64 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Api\Query\Wiki\Video\Script;
|
|
|
|
use App\Http\Api\Query\Base\EloquentReadQuery;
|
|
use App\Http\Api\Schema\EloquentSchema;
|
|
use App\Http\Api\Schema\Wiki\Video\ScriptSchema;
|
|
use App\Http\Resources\BaseCollection;
|
|
use App\Http\Resources\BaseResource;
|
|
use App\Http\Resources\Wiki\Video\Collection\ScriptCollection;
|
|
use App\Http\Resources\Wiki\Video\Resource\ScriptResource;
|
|
use App\Models\Wiki\Video\VideoScript;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
|
/**
|
|
* Class ScriptReadQuery.
|
|
*/
|
|
class ScriptReadQuery extends EloquentReadQuery
|
|
{
|
|
/**
|
|
* Get the resource schema.
|
|
*
|
|
* @return EloquentSchema
|
|
*/
|
|
public function schema(): EloquentSchema
|
|
{
|
|
return new ScriptSchema();
|
|
}
|
|
|
|
/**
|
|
* Get the query builder of the resource.
|
|
*
|
|
* @return Builder
|
|
*/
|
|
public function builder(): Builder
|
|
{
|
|
return VideoScript::query();
|
|
}
|
|
|
|
/**
|
|
* Get the json resource.
|
|
*
|
|
* @param mixed $resource
|
|
* @return BaseResource
|
|
*/
|
|
public function resource(mixed $resource): BaseResource
|
|
{
|
|
return new ScriptResource($resource, $this);
|
|
}
|
|
|
|
/**
|
|
* Get the resource collection.
|
|
*
|
|
* @param mixed $resource
|
|
* @return BaseCollection
|
|
*/
|
|
public function collection(mixed $resource): BaseCollection
|
|
{
|
|
return new ScriptCollection($resource, $this);
|
|
}
|
|
}
|