Category: Laravel

In this short post, I will be explaining the form request class, its default methods, and how to utilize this form request to match more than one HTTP method. Just to point out, Laravel also has a validation factory (Illuminate\Validation\Factory) class, which in my opinion, is more often used by developers than the form request class. The validation factory class seems to be the default validation method Laravel ships out with the controller and this validation factory can be accessed in the controller without any user setup via: $this->validate($request,$rules,$messages,$customAttributes).

This method works pretty fine but when the validation logic grows, it is often advised to move it to its own class, hence the Form Request Class.

Having explained the concepts surrounding the readily available validate method and the user-created form request class, let me move to the main problem that this post aims to shed light on.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners