laravel-orion
laravel-orion copied to clipboard
[Feature Request] setAppends
This may be something more suited to userland, yet I thought it was worth asking!
Sometimes, we want to include attributes in our request. Laravel allows us to automatically append these attributes with appends
protected $appends = ['is_admin'];
However, often we only want those attributes on occassion. So My feature request is this.
Allow the developer to have an appends array on the Controller, similar to how we currently use includes
protected function appends() : array
{
return ['is_admin'];
}
Then we can use the following query to only append what we need:
(GET) https://myapp.com/api/users?appends=is_admin
Thoughts? :smiley:
Hi @ldiebold,
This is a good one! I will put it on the roadmap 👌