Category: Laravel

Passionate full-stack developer with an eye for usability and carefully crafted interfaces. Laravel provides different approaches to validate your application’s incoming data. My favorite method to validate input data in controllers is to create Form Requests: custom request classes that contain authorization and validation logic.

Creating a new form request is straightforward because we can leverage an Artisan command: And here’s the code: As you can see we are applying a custom validation rule on the synonyms field.

We can leverage this method to provide a completely custom error message, modeled around the validation failures.
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