Review: Mastering Laravel Validation Rules
Tags: laravel, php, webdev
Published: 2023-01-03 22:32:24

*Disclaimer: All links to the "[Mastering Laravel Validation Rules](https://ashallendesign.co.uk/s/mastering-laravel-validation-rules)" ebook on this page are affiliate links. This means that if you buy the book after clicking on one of my links, I'll get a tiny kickback that helps to support the blog.*

## Introduction

One thing I love about the Laravel world is that it's full of awesome resources to help improve as a developer. New content is constantly being released that helps make our lives easier, and our application's better!

This is exactly what the "[Mastering Laravel Validation Rules](https://ashallendesign.co.uk/s/mastering-laravel-validation-rules)" ebook by [Aaron Saray](https://www.aaronsaray.com/) and [Joel Clermont](https://twitter.com/jclermont) does. I recently gave this ebook a read and really enjoyed it.

So I thought I'd write a short review about the ebook to help you decide whether you should give it a read.

## Book Summary

[Mastering Laravel Validation Rules](https://ashallendesign.co.uk/s/mastering-laravel-validation-rules) kicks off with an introduction that scares you into wanting to read more! It starts with a horror story that every developer dreads happening to themselves - their web application being hacked!

I think this is a great way to open up because you immediately know that what you're about to read is going to be vital for your application's security!

The book then covers why we need to use validation in our web applications and how it can improve your application's security, data integrity and general data quality.

It then moves on to showing you different ways that you can organise your validation logic in your application. I particularly enjoyed reading this section because I saw that the way they advise approaching validation is the same as how I'd do it. So it was nice to get some reassurance for myself and see that I'm following the same conventions as other developers.

After this, it then steps through different validation rules that the framework provides and gives in-depth examples of how you can use these in your own application. I loved reading through this section and thought to myself "I wish I'd have had this when I'd first started out with Laravel". If I was brand new to Laravel, I'd view this part as almost being a bit of a cheatsheet. I'll definitely be coming back to re-read this section and use it as a point of reference.

[The book](https://ashallendesign.co.uk/s/mastering-laravel-validation-rules) then goes on to discuss some more advanced validation topics such as creating your own validation rules and using conditional rules. I feel like this section is something that every Laravel developer would find useful because creating more flexible validation logic can help to improve your app's security. It can also make it easier for you to reuse your validation logic across your codebase and improve the maintainability and testability of your code (which, if you've read any of my articles before, you'll know that I'm a huge fan of!).

The book finishes by showing us some in-depth real world examples of using validation in your Laravel projects. The examples give a break down of the scenario and the validation that was added. It also provides an insight into why the particular validation logic was chosen and what could potentially happen if the validation wasn't present. This part is great because I feel like it ties together everything you've read so far in the book and gives some insight and context to help solidify what you've learned.

The book also comes with 10 exercises that you can complete while reading the book. The exercises come in the form of a demo Laravel application in which you're required to use validation rules and test that you're using the correct ones. I think this is great idea! It allows you to take what you've learned from the book and put it into action.

## What I Loved About the Book

After reading [Mastering Laravel Validation Rules](https://ashallendesign.co.uk/s/mastering-laravel-validation-rules), I genuinely came away feeling like I'd learned something new. I even enjoyed reading the "Beginner and Common Rules" chapter because I felt like it was a great way of recapping the fundamentals.

I also loved the real-life horror story at the beginning of the book. I feel like some developers sometimes think validation is a overkill and not needed, because "who's ever going to want to hack into my application?". But reading this was a great way of letting readers know that it *can* and *does* happen. So I thought this section alone gets you into the mindset ready to learn.

I especially loved the real-life examples in the book. I'm the type of person that learns most by seeing something in action. No matter how much I try, I really struggle to understand code examples when they're using `foo`, `bar`, `baz`. But the book completely avoids any of that and gives you context of how, where, and why you'd want to use certain validation rules. I think the exercises help reinforce this by allowing you to try out the validation rules yourself to pass each exercise.

The friendly, chatty vibe of the book is another I absolutely love! For a long time after getting out full-time education, I've been scared to pick up any kind of book that revolves around learning. I think I'm still a little scarred from the dull, boring text books that we used to have to read at school. So I always think that any book that's slightly educational will be boring, formal, and a chore to read. But I've recently tried getting into reading more educational books and realised that they're not at all like that. In particular, this book is nothing like that at all! I almost felt like I was having a conversation with Aaron and Joel while reading it. So it felt pretty fun to read, and I loved the little "Joel says..." sections that interject a little bit of extra information every so often. I think it's a really nice touch!

## What I Didn't Love About the Book

To be honest, there wasn't anything that I didn't love about it! I think it was a great book and there wasn't anything about the content that I'd change.

Now, I know that you might be thinking "You would say that, you've got an affiliate link for the book so you want us to buy it". But I wouldn't ever promote anything if I didn't genuinely think it would be useful to my readers. One of my biggest goals as a member of the Laravel community is to help people learn, grow, and improve as developers. So I wouldn't try and convince you to spend your hard-earned money on something if I didn't think it was worth it.

The only downside that I think some people may have is that [the book](https://ashallendesign.co.uk/s/mastering-laravel-validation-rules) isn't available as an EPUB (at the time of writing this article). So it might be a difficult to read it using an e-reader. I don't personally use an e-reader, so that isn't really a downside for me, but I know that for some people it might be. It's very possible that an EPUB version will be released in the future though.

## Would I Recommend Buying It?

In short, **YES**!

Especially for the low cost of $9.99 (at the time of writing this article).

I can see [Mastering Laravel Validation Rules](https://ashallendesign.co.uk/s/mastering-laravel-validation-rules) being useful for Laravel developers at all levels. I think it could be a great resource for developers new to the Laravel world that are looking for ways to improve their security and validation knowledge.

In my opinion, I could also see this being a really useful guide for businesses and development teams to buy for their junior developers. When I first started out as a developer, I was aware of what validation was and used the basics, but I never really made use of all the cool stuff Laravel offers. This was mainly due to the fact that I didn't know how or where to use it.

Looking back now, after years of experience, it all makes more sense on how and where you'd use the different validation rules. But I feel like if I had this book that I'd have sped that process up and got to the same stage in a matter of days or weeks.

Having that extra insight into the decision making process of how to improve your validation is extremely valuable because you're learning from someone else's experience.

## Conclusion

Hopefully, this post should have given you a brief insight into the "[Mastering Laravel Validation Rules](https://ashallendesign.co.uk/s/mastering-laravel-validation-rules)" ebook. If you're interested in improving your Laravel application's security, I'd definitely recommend picking up a copy of the book.

If you enjoyed reading this post, I'd love to hear about it. Likewise, if you have any feedback to improve the future ones, I'd also love to hear that too.

If you're interested in getting updated each time I publish a new post, feel free to [sign up for my newsletter](https://ashallendesign.co.uk/blog).

Keep on building awesome stuff! 🚀