mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-09-24 13:26:07 +02:00
50 lines
1.1 KiB
PHP
50 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\GraphQL\Schema\Fields\Wiki\Studio;
|
|
|
|
use App\Contracts\GraphQL\Fields\CreatableField;
|
|
use App\Contracts\GraphQL\Fields\RequiredOnCreation;
|
|
use App\Contracts\GraphQL\Fields\UpdatableField;
|
|
use App\GraphQL\Schema\Fields\StringField;
|
|
use App\Models\Wiki\Studio;
|
|
|
|
class StudioNameField extends StringField implements CreatableField, RequiredOnCreation, UpdatableField
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct(Studio::ATTRIBUTE_NAME, nullable: false);
|
|
}
|
|
|
|
public function description(): string
|
|
{
|
|
return 'The primary title of the Studio';
|
|
}
|
|
|
|
/**
|
|
* @param array<string, mixed> $args
|
|
*/
|
|
public function getCreationRules(array $args): array
|
|
{
|
|
return [
|
|
'required',
|
|
'string',
|
|
'max:192',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @param array<string, mixed> $args
|
|
*/
|
|
public function getUpdateRules(array $args): array
|
|
{
|
|
return [
|
|
'sometimes',
|
|
'required',
|
|
'string',
|
|
'max:192',
|
|
];
|
|
}
|
|
}
|