belongsTo(Unidade::class); } /** * @return string */ public function __toString() { return $this->name; } public static function validator($attributes, $rule_password = false) { $rules = [ 'name' => ['required', ] ]; $messages = [ // 'unique' => "O :attribute já está registrado no sistema", 'required' => "O :attribute precisa ser preenchido", ]; try { return Validator::make($attributes, $rules, $messages); } catch(ValidationException $exception) { } } }