mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-09-29 23:56:56 +02:00
50 lines
1.0 KiB
PHP
50 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\GraphQL\Schema\Fields\Pivot\Morph\Imageable;
|
|
|
|
use App\Contracts\GraphQL\Fields\CreatableField;
|
|
use App\Contracts\GraphQL\Fields\UpdatableField;
|
|
use App\GraphQL\Schema\Fields\IntField;
|
|
use App\Pivots\Morph\Imageable;
|
|
|
|
class ImageableDepthField extends IntField implements CreatableField, UpdatableField
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct(Imageable::ATTRIBUTE_DEPTH);
|
|
}
|
|
|
|
public function description(): string
|
|
{
|
|
return 'Used to sort the images';
|
|
}
|
|
|
|
/**
|
|
* @param array<string, mixed> $args
|
|
*/
|
|
public function getCreationRules(array $args): array
|
|
{
|
|
return [
|
|
'sometimes',
|
|
'required',
|
|
'integer',
|
|
'min:1',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @param array<string, mixed> $args
|
|
*/
|
|
public function getUpdateRules(array $args): array
|
|
{
|
|
return [
|
|
'sometimes',
|
|
'required',
|
|
'integer',
|
|
'min:1',
|
|
];
|
|
}
|
|
}
|