mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-25 16:24:35 +02:00
38 lines
994 B
PHP
38 lines
994 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\GraphQL\Validators\User;
|
|
|
|
use App\Models\Wiki\Anime\Theme\AnimeThemeEntry;
|
|
use Illuminate\Support\Str;
|
|
use Illuminate\Validation\Rule;
|
|
use Nuwave\Lighthouse\Validation\Validator;
|
|
|
|
class ToggleLikeMutationValidator extends Validator
|
|
{
|
|
/**
|
|
* Return the validation rules.
|
|
*
|
|
* @return array<string, array<mixed>>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'entryId' => [
|
|
Str::of('prohibits:')->append('playlistId')->__toString(),
|
|
'required_without_all:'.implode(',', [
|
|
'playlistId',
|
|
]),
|
|
Rule::exists(AnimeThemeEntry::TABLE, AnimeThemeEntry::ATTRIBUTE_ID),
|
|
],
|
|
'playlistId' => [
|
|
Str::of('prohibits:')->append('entryId')->__toString(),
|
|
'required_without_all:'.implode(',', [
|
|
'entryId',
|
|
]),
|
|
],
|
|
];
|
|
}
|
|
}
|