user() !== null; } public function rules(): array { $columnRule = Rule::in(SegmentContractsExport::allowedColumns()); return [ 'scope' => ['required', Rule::in([self::SCOPE_CURRENT, self::SCOPE_ALL])], 'columns' => ['required', 'array', 'min:1'], 'columns.*' => ['string', $columnRule], 'search' => ['nullable', 'string', 'max:255'], 'client' => ['nullable', 'string', 'max:64'], 'page' => ['nullable', 'integer', 'min:1'], 'per_page' => ['nullable', 'integer', 'min:1', 'max:200'], ]; } protected function prepareForValidation(): void { $this->merge([ 'client' => $this->input('client') ?? $this->input('client_id'), 'per_page' => $this->input('per_page') ?? $this->input('perPage'), ]); } }