-
Notifications
You must be signed in to change notification settings - Fork 26
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I have a model named Audit and it has a auditable_type field which is multi field with types keyword and text .
I tried to use accessors to format the retrevived auditable_type and realized that accessors are not working . even accessor function did not called .
Audit.php
<?php
...
class Audit extends Model
{
...
public function getAuditableTypeAttribute(string $value)
{
return collect(array_filter(explode('\\', $value), function ($item) {
return $item != null && $item != '';
}))->last();
}
}AuditRepository.php
$column = "auditable_type.keyword";
Audit::distinct($column)->get($column)->pluck([$column]); // we expect that accessor format the field .To Reproduce
Create a model using laravel-elasticsearch package and try to implement an accessor for a text field .
Expected behavior
We Expect that model accessor format the desired field correctly .
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working