check(); } /** * Prepare the data for validation. * * @return void */ protected function prepareForValidation(): void { $this->merge([ 'direction' => $this->direction === 'up' ? true : false ]); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules(): array { return [ 'direction' => 'required|boolean', ]; } /** * Get custom attributes for validator errors. * * @return array */ public function attributes(): array { return [ 'direction' => trans('validation.custom.direction'), ]; } }