/** * Get the validation rules that apply to the request. * * @return array */ public function rules() { switch ($this->method) { case 'GET': break; case 'DELETE': break; case 'POST': return Domain::createRules(); case 'PUT': break; case 'PATCH': return Domain::updateRules($this); default: break; } return []; }
/** * {@inheritdoc}. */ protected function getValidator($model) { return Validator::make($model->toArray(), Domain::createRules()); }