Fixes #8+
Enums arent using BaseEnum trait and cannot since tool low php level, need to manually implement behaviors
This commit is contained in:
parent
c6eaf2f12b
commit
50832db21b
2 changed files with 21 additions and 1 deletions
|
|
@ -48,4 +48,24 @@ class Historique extends Model
|
|||
{
|
||||
return $this->belongsTo(Media::class);
|
||||
}
|
||||
|
||||
// * METHODS
|
||||
|
||||
/**
|
||||
* Get the instance as an array.
|
||||
*
|
||||
* @return array<TKey,TValue>
|
||||
*/
|
||||
public function toArray(): array
|
||||
{
|
||||
return \array_merge(
|
||||
parent::toArray(),
|
||||
[
|
||||
'type' => [
|
||||
'value' => $this->type,
|
||||
'label' => $this->type->label()
|
||||
]
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
item.user.matricule
|
||||
}})
|
||||
</td>
|
||||
<td>{{ item.type }}</td>
|
||||
<td>{{ item.type.label }}</td>
|
||||
<td>{{ item.description }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue