Replies: 1 comment
-
|
If you want a hack around it (which I don't necessarily like myself).. you can throw an abort error using an observer on barClass https://laravel.com/docs/9.x/eloquent#events Have you tried using the general attachAny rather than attachAnyBar to see if you will get the same result? you could also just directly do it from the resource to test it out |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to limit the number of models that can be attached to another model in Nova.
Let's say I have the following setup with
FooandBar.Models
Nova Resources
Policies
attachAnyBarmethod hides the 'Attach Bar' button in the Foo detail view whenever the maximum is reached, although the/attach/bar-resourcesroute is still accessible manually when I'd expect a 403.So it technically works in that a user is never able to attach more than the maximum, but this all feels like bad UX to me.
Beta Was this translation helpful? Give feedback.
All reactions