mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-01-17 09:20:42 -06:00
After 10+ hours of debugging and searching through livewire issues, it turns out that the query string doesn't update if you have `history: true` in the `#[Url()]` attribute.
60 lines
1.4 KiB
PHP
60 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use App\Models\Language;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class UpdateGeneralSettingRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'censor' => [
|
|
'required',
|
|
'boolean',
|
|
],
|
|
'chat_hidden' => [
|
|
'required',
|
|
'boolean',
|
|
],
|
|
'locale' => [
|
|
'required',
|
|
Rule::in(array_keys(Language::allowed())),
|
|
],
|
|
'style' => [
|
|
'required',
|
|
'numeric',
|
|
],
|
|
'custom_css' => [
|
|
'nullable',
|
|
'url',
|
|
],
|
|
'standalone_css' => [
|
|
'nullable',
|
|
'url',
|
|
],
|
|
'torrent_layout' => [
|
|
'required',
|
|
Rule::in([0, 1, 2, 3]),
|
|
],
|
|
'torrent_sort_field' => [
|
|
'required',
|
|
Rule::in(['created_at', 'bumped_at']),
|
|
],
|
|
'show_poster' => [
|
|
'required',
|
|
'boolean',
|
|
],
|
|
];
|
|
}
|
|
}
|