Keep controllers clean by using form requests in Laravel

Original – by Freek Van der Herten – 1 minute read

Most people use form requests solely for validation, but they can also help to keep your controllers clean. Here's how we use them in Mailcoach

Stay up to date with all things Laravel, PHP, and JavaScript.

Follow me on Twitter. I regularly tweet out programming tips, and what I myself have learned in ongoing projects.

Every two weeks I send out a newsletter containing lots of interesting stuff for the modern PHP developer.

Expect quick tips & tricks, interesting tutorials, opinions and packages. Because I work with Laravel every day there is an emphasis on that framework.

Rest assured that I will only use your email address to send you the newsletter and will not use it for any other purposes.

Comments

Webmentions

IT DEV GROUP liked on 4th May 2021
Loki liked on 4th May 2021
Abdelkader Mh liked on 4th May 2021
ali ali liked on 4th May 2021
Burhan liked on 4th May 2021
shabnam liked on 4th May 2021
Omar liked on 4th May 2021
devzaim liked on 4th May 2021
Faisal Khan liked on 4th May 2021
Boy Thanakorn liked on 4th May 2021
Faisal Khan retweeted on 4th May 2021
IT DEV GROUP retweeted on 4th May 2021
Mudassir Ahmad Adili liked on 4th May 2021
Padam Shankhadev liked on 4th May 2021
Laravel Digest retweeted on 4th May 2021
Laravel Digest liked on 4th May 2021
Joy Debnath liked on 4th May 2021
#CriminalizeRacism liked on 4th May 2021
Phil Young liked on 4th May 2021
Salman Zafar liked on 4th May 2021
Alejandro Vásquez N. liked on 4th May 2021
Angad Dubey liked on 4th May 2021
Martin Medina liked on 4th May 2021
Quentin Schmick liked on 4th May 2021
Ali Mahdavi liked on 4th May 2021
Alex liked on 4th May 2021
Khuram Javes replied on 4th May 2021
How to use Form Requests in Lumen?
Mohd Amsyar liked on 4th May 2021
Hardik Patel liked on 4th May 2021
Hardik Patel retweeted on 4th May 2021
Damian Aguilar retweeted on 4th May 2021
Marek Racík liked on 4th May 2021
Alexandr Nita liked on 3rd May 2021
Alexandr Nita retweeted on 3rd May 2021
Andrew Caya retweeted on 3rd May 2021
Jona Goldman liked on 3rd May 2021
Cristóbal liked on 3rd May 2021
Peter Brinck 🤘 liked on 3rd May 2021
Deven Jahnke retweeted on 3rd May 2021
maesbn 🌲 liked on 3rd May 2021
maesbn 🌲 retweeted on 3rd May 2021
Tommi Meyer liked on 3rd May 2021
Domantas liked on 3rd May 2021
Quintus van Vuuren replied on 3rd May 2021
For interest sake, what do you guys at Spatie use for naming your form request types? Do you suffix it with 'Request'?
Amine TIYAL liked on 3rd May 2021
Steve McDougall liked on 3rd May 2021
Weeb Developer retweeted on 3rd May 2021
Robert Askam liked on 3rd May 2021
jed1knyt liked on 3rd May 2021
Robert Askam retweeted on 3rd May 2021
Phil Rowley liked on 3rd May 2021
Nathan Langer liked on 3rd May 2021
Haroon🇵🇰🇦🇪 liked on 3rd May 2021
Mike liked on 3rd May 2021
Weeb Developer liked on 3rd May 2021
Saibal Roy liked on 3rd May 2021
Tarsísio Xavier liked on 3rd May 2021
Arthur Kyagulanyi liked on 3rd May 2021
Tim Joosten liked on 3rd May 2021
Gergo Ratting liked on 3rd May 2021
Tauseef shah liked on 3rd May 2021
David Cottila retweeted on 3rd May 2021
José Cage retweeted on 3rd May 2021
Ajith Lal retweeted on 3rd May 2021
Qisthi Ramadhani retweeted on 3rd May 2021
Spatie retweeted on 3rd May 2021
Anatoli Nicolae liked on 3rd May 2021
ZakoDev liked on 3rd May 2021
Afzal Abbas liked on 3rd May 2021
Toan Nguyen retweeted on 3rd May 2021
Qisthi Ramadhani liked on 3rd May 2021
Lucas Silva liked on 3rd May 2021
ichiroadris liked on 3rd May 2021
Wyatt liked on 3rd May 2021
Jordi 🎗 liked on 3rd May 2021
Captain Barbosa liked on 3rd May 2021
yaslam liked on 3rd May 2021
Radin liked on 3rd May 2021
Orest liked on 3rd May 2021
Ajith Lal liked on 3rd May 2021
Craig Lovelock liked on 3rd May 2021
Paint liked on 3rd May 2021
Shafqat ali liked on 3rd May 2021
José Cage liked on 3rd May 2021
Adam Wills liked on 3rd May 2021
mel liked on 3rd May 2021
Mior Muhammad Zaki liked on 3rd May 2021
ArielMejiaDev liked on 3rd May 2021
Laravel Magazine liked on 3rd May 2021
Mior Muhammad Zaki retweeted on 3rd May 2021
ArielMejiaDev retweeted on 3rd May 2021
Laravel Magazine retweeted on 3rd May 2021
Sebastian Rasch liked on 3rd May 2021
Amaury Cid liked on 3rd May 2021
Claudio_Pereira liked on 3rd May 2021
Marian Pop 🦄 retweeted on 3rd May 2021
Jānis Lācis liked on 3rd May 2021
Ishaan Sheikh liked on 3rd May 2021
Nasirou Wagana liked on 3rd May 2021
Abrar Ahmad liked on 3rd May 2021
Marian Pop 🦄 liked on 3rd May 2021
Uziel Bueno liked on 3rd May 2021
Vaggelis Yfantis liked on 3rd May 2021
Renato Lucena liked on 3rd May 2021
PHP Synopsis retweeted on 3rd May 2021
Laravel tweets 🤖 retweeted on 3rd May 2021
Luiyi Diloné retweeted on 3rd May 2021
Rey Mar Gualvez retweeted on 3rd May 2021
Owen Voke retweeted on 3rd May 2021
Nathanael McDaniel 🖥 liked on 3rd May 2021
Rajeev Choudhary liked on 3rd May 2021
Ryan C. liked on 3rd May 2021
Daniel liked on 3rd May 2021
Estern Winluck liked on 3rd May 2021
Pratik Rane liked on 3rd May 2021
Towhid liked on 3rd May 2021
Petar Ratkovic liked on 3rd May 2021
Dumitru Botezatu liked on 3rd May 2021
Asadujjaman Sagor liked on 3rd May 2021
mateusmelo.js liked on 3rd May 2021
Laravel tweets 🤖 liked on 3rd May 2021
Seba Ramírez Pastore liked on 3rd May 2021
Todd Smith-Salter liked on 3rd May 2021
Michael Aguiar liked on 3rd May 2021
Aidan Casey liked on 3rd May 2021
Johan Frank liked on 3rd May 2021
Ovadya Yosef liked on 3rd May 2021
Robin Dirksen liked on 3rd May 2021