lorisleiva / laravel-actions

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

Use FormRequest methods in asController method #184

Open florentsorel opened 2 years ago

florentsorel commented 2 years ago

Hi,

I would like to use some method from FormRequest object like safe, validated but the asController method need a Request object and the method safe doesn't exists inside this object and I prefer to avoid the use of except method.

It's possible to handle this?

tommica commented 2 years ago

Isn't this solved by using Lorisleiva\Actions\ActionRequest?

public function asController(ActionRequest $request) {...}

https://laravelactions.com/2.x/add-validation-to-controllers.html#add-validation-to-your-controllers