mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-11 09:34:50 +02:00
8b6b196c99
* 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
51 lines
1.1 KiB
PHP
51 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Api\Query\Wiki\Video\Script;
|
|
|
|
use App\Http\Api\Query\Base\EloquentWriteQuery;
|
|
use App\Http\Api\Schema\EloquentSchema;
|
|
use App\Http\Api\Schema\Wiki\Video\ScriptSchema;
|
|
use App\Http\Resources\BaseResource;
|
|
use App\Http\Resources\Wiki\Video\Resource\ScriptResource;
|
|
use App\Models\Wiki\Video\VideoScript;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
|
/**
|
|
* Class ScriptWriteQuery.
|
|
*/
|
|
class ScriptWriteQuery extends EloquentWriteQuery
|
|
{
|
|
/**
|
|
* 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, new ScriptReadQuery());
|
|
}
|
|
}
|