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