Laravel/Eloquent - Eager loaded hidden/visible properties

前端 未结 2 652
广开言路
广开言路 2021-01-18 00:56

When using Laravel\'s Eloquent ORM, I can\'t seem to set the $hidden and $visible properties on my Model dynamically.

Example 1: This works:

2条回答
  •  别那么骄傲
    2021-01-18 01:35

    As $visible is set on an instance level (i.e. it's not a static variable shared between all models of the same type), no - there's no better way to do this.

提交回复
热议问题