'required|max_length[50]|is_unique[roles.role_code,id,{id}]', 'role_name' => 'required|max_length[100]', ]; protected $validationMessages = []; protected $skipValidation = false; protected $cleanValidationRules = true; public function findByCode(string $code): ?Role { return $this->where('role_code', $code)->first(); } }