[BUG] Fields are not shown when using the $visible property
stevenberg opened this issue · comments
Steven Berg commented
Describe the bug
When a model class uses the $visible
property to hide attributes, attributes that are not included in the $visible
array are not shown in Prequel.
To Reproduce
Use the $visible
property instead of $hidden
:
protected $visible = [
'created_at',
'email',
'id',
'name',
'updated_at',
];
Fix
I think this can be fixed by changing line 76 of DatabaseController.php from
$paginated->setCollection($paginated->getCollection()->makeVisible($hidden));
to
$paginated->getCollection()->each->setHidden([])->each->setVisible([]);
Which removes both the $hidden
and $visible
properties from the objects in the collection.
Quinten commented
Thanks for including a fix! Included in next release.