lorisleiva / laravel-actions

⚡️ Laravel components that take care of one specific task
https://laravelactions.com
MIT License
2.52k stars 124 forks source link

validateAttributes make more visible in docs #127

Closed kiwina closed 3 years ago

kiwina commented 3 years ago

Hi, i suggest making it more obbvious in the docs that authorization only gets triggered when validateAttributes gets called. Or even better change the implementation as its counter intuitive to "validateAttributes" even if there is no attributes to trigger authorization

artworkad commented 3 years ago

@kiwina do you mean $this->authorize? Using Gate::authorize works fine for me, even without validateAttributes. See https://github.com/lorisleiva/laravel-actions/discussions/124

kiwina commented 3 years ago

@kiwina do you mean $this->authorize? Using Gate::authorize works fine for me, even without validateAttributes. See #124

No when you use WithAttributes you have to call validateAttributes in order to trigger authorize witch drove me mad understanding why it didn't work till i saw the line in the online docs but its not really intuitive to call a method named "validateAttributes" to authorise

lorisleiva commented 3 years ago

Hi there 👋

I see what you mean but this is documented twice on the documentation — once in the guide and once in the references — so I'm not sure there's much more that can be done there.

Feel free to submit a PR to the docs if you have a suggestion. 🙂