Dont add hints for internal attributes. Our hints now also returns a collection.
This commit is contained in:
parent
66537dcec8
commit
6b2fb8dee4
@ -226,12 +226,15 @@ class Attribute implements \Countable, \ArrayAccess
|
|||||||
/**
|
/**
|
||||||
* Return the hints about this attribute, ie: RDN, Required, etc
|
* Return the hints about this attribute, ie: RDN, Required, etc
|
||||||
*
|
*
|
||||||
* @return array
|
* @return Collection
|
||||||
*/
|
*/
|
||||||
public function hints(): array
|
public function hints(): Collection
|
||||||
{
|
{
|
||||||
$result = collect();
|
$result = collect();
|
||||||
|
|
||||||
|
if ($this->is_internal)
|
||||||
|
return $result;
|
||||||
|
|
||||||
// Is this Attribute an RDN
|
// Is this Attribute an RDN
|
||||||
if ($this->is_rdn)
|
if ($this->is_rdn)
|
||||||
$result->put(__('rdn'),__('This attribute is required for the RDN'));
|
$result->put(__('rdn'),__('This attribute is required for the RDN'));
|
||||||
@ -246,7 +249,7 @@ class Attribute implements \Countable, \ArrayAccess
|
|||||||
if ($this->isDynamic())
|
if ($this->isDynamic())
|
||||||
$result->put(__('dynamic'),__('These are dynamic values present as a result of another attribute'));
|
$result->put(__('dynamic'),__('These are dynamic values present as a result of another attribute'));
|
||||||
|
|
||||||
return $result->toArray();
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,11 +24,11 @@ final class RDN extends Attribute
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function hints(): array
|
public function hints(): Collection
|
||||||
{
|
{
|
||||||
return [
|
return collect([
|
||||||
'required' => __('RDN is required')
|
'required' => __('RDN is required')
|
||||||
];
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function render(bool $edit=FALSE,bool $old=FALSE,bool $new=FALSE): View
|
public function render(bool $edit=FALSE,bool $old=FALSE,bool $new=FALSE): View
|
||||||
|
Loading…
x
Reference in New Issue
Block a user