You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the apiSingleton() I have the ability to add a creatable() if I want it to be able to store the singleton. However, in my case I only want it to include store and not destroy. Which should be doable with ->only('store') or ->exist('destroy'), but it's not excluding it.
To me, I would expect the apiSingleton act kinda similar to apiResource
A quick look at the code, it seems like createable() and destroyable() does not care about these constraints and just returns their own expected methods:
We've discussed this internally, in these methods creatable and destroyable were not meant to be combined with other things like only. However, we may reconsider this, so we've created this pull request: #47098.
Going to close this issue here, so we can follow up this issue more closely on the pull request I've created. Thank you for reporting this.
Laravel Version
10.10.1
PHP Version
8.2.5
Database Driver & Version
No response
Description
When using the
apiSingleton()
I have the ability to add acreatable()
if I want it to be able to store the singleton. However, in my case I only want it to includestore
and notdestroy
. Which should be doable with->only('store')
or->exist('destroy')
, but it's not excluding it.To me, I would expect the
apiSingleton
act kinda similar toapiResource
A quick look at the code, it seems like
createable()
anddestroyable()
does not care about these constraints and just returns their own expected methods:Steps To Reproduce
Add following to
api.php
In console run
php artisan route:list
:The text was updated successfully, but these errors were encountered: