Battle Ready Laravel

A guide to auditing, testing, fixing, and improving your Laravel applications

Over 400+ copies sold! πŸŽ‰ Only $39!
Battle Ready book cover

It's full of great tips and recommendations that every Laravel developer really needs to know.

Stephen Rees-Carter profile picture

Stephen Rees-Carter

Following its clear, comprehensive, and well-written content will leave you feeling so much more confident about your apps.

Matt Kingshott profile picture

Matt Kingshott

As a lookup or read, it's a comprehensive guide to worry-free development.

Nicolai Baaring profile picture

Nicolai Baaring

Auditing chapter



Testing chapter



Fixing chapter



Improving chapter



Suffering from Technical Debt?

Do you want to learn how to audit, test, fix and improve your Laravel web apps?

Battle Ready Laravel is your ultimate guide to creating bulletproof Laravel applications . You will learn how to improve the performance, maintainability and security of your Laravel projects. Battle Ready Laravel provides you with hands-on experience and starting points on how to audit, test, fix and improve your Laravel web apps.

It is a great resource for both experienced and inexperienced Laravel developers looking to improve their codebase and application’s quality.

What's Covered in the Book?

As a freelance web developer, I'm really lucky and I get the chance to work on a lot of exciting projects. The majority of the time, the projects that I work on are existing projects and I'm brought on board to help add extra functionality, remove technical debt , add test suites , and generally improve the maintainability of the system .

In this book, I'm going to take you through the exact same steps that I use when improving Laravel projects . You'll be given actionable advice and steps that you can use straight away in your own projects.

What Will I Learn?

We'll start by learning how to use automated tools and manual methods to audit the codebase and find weaknesses and areas to improve .

You'll then learn how to write tests that increase our confidence in our code and reliability for our end users.

You'll learn how to reduce (and hopefully remove!) technical debt and fix bugs. I'll also show the most common mistakes and errors that I see in Laravel apps and show you can avoid them yourself.

By the end of the book, you should feel like a more confident developer and have a better insight into how to manage your Laravel apps to keep them efficient, testable, and maintainable ! πŸš€

220+ Pages

Battle Ready Laravel comes with over 220 pages of useful tips, tricks, and guides.

$195 of Discounts

The book comes with over $195 worth of discounts for Flare, Oh Dear, StyleCI, and Laravel Security in Depth.

4 Sections

The content is split into 4 distinct sections: Auditing, Testing, Fixing, and Improving.

Light and Dark Mode

The book comes in both light mode and dark mode.

Actionable Advice

Packed with actionable advice that you can start using right away.

Real-life Examples

Full of real-life examples to help understand how to improve your code.



Automated Tools

Explore and look at the different automated tools that you can use to audit your app, including: Larastan, PHPInsights, and Enlightn

Manual Auditing

Learn different approaches that you can take to manually audit your app to find slow, insecure or unmaintainable code that can be improved

Find Weak Spots

Learn how to find weak spots in your Laravel apps that do not have enough test coverage

Auditing chapter
Testing chapter


Add Critical Tests

Learn how to prioritise your testing and write tests that cover the mission-critical parts of your code.

Catch Bugs Early

Learn about how you can use automated tooling in your application to catch bugs early.

GitHub Actions

Explore how you can use GitHub Actions to add workflows to run your tests and reduce the chances of broken or unmaintainable code making it to production.



Fixing and Catching Bugs

Learn how to use your new test suite to update your code and remove bugs

Updating Dependencies

Explore different approaches that you can take to safely update your legacy system's dependencies, Laravel version and PHP version without breaking your existing code

Fixing Security Holes

Look at the different ways that you can fix the security holes spotted during your audit and testing

Fixing chapter
Improving chapter


Clean Up Existing Code

Learn how to use best-practices to improve your code and make it more testable, maintainable and readable.

Removing Technical Debt

Explore different ways that you can remove technical debt from your codebase to improve the code you will write in the future.

Improve Your Future Code

Learn how to use clean-code principles to improve the code you write in the future.


Up to $195 of Included Discounts!

Battle Ready Laravel will come with up to $195 USD worth of discount codes* for you to use!

Thanks to the generosity of Spatie, StyleCI and Laravel Security In Depth, if you purchase Battle Ready Laravel will get limited-edition discount codes for using with Flare, OhDear, StyleCI, and Laravel Security In Depth!

Discounts for OhDear

The book will include a €5 EUR discount for the first 3 months of new OhDear subscriptions.

Discounts for Flare

The book will include a €10 EUR discount for the first 3 months of new Flare subscriptions.

Discounts for StyleCI

The book will include a 20% discount for the first payment of new "Startup" or "Premium" StyleCI subscriptions.

Discounts for Laravel Security In Depth

The book will include a 25% discount for 1 year of new Laravel Security In Depth subscriptions.

* - Based on the exchange rates at the time of writing this (27th June 2022). The actual value may be different when redeeming the discount codes.

Flare logo OhDear logo StyleCI logo

Sections & Chapters Covered

Table Of Contents

Section 1: Auditing

  1. βœ”What's Covered
  2. βœ”Planning Your Auditing Strategy
    • ↳Getting Into the Right Mindset
    • ↳Recording Your Findings
  3. βœ”Automated Tooling
    • ↳PHP Insights
    • ↳Enlightn
    • ↳Larastan
    • ↳StyleCI
    • ↳Code Coverage
  4. βœ”Manual Auditing
    • ↳Investigating "raw" Database Queries
    • ↳Finding Incorrect Authorisation
    • ↳Checking Validation
    • ↳Finding "Fake Facades"
    • ↳Finding Business Logic in Helpers
    • ↳Finding N+1 Queries
    • ↳Finding Controllers That Use Other Controllers
    • ↳Finding Logic and Queries in Blade Views
    • ↳Finding Hard Coded Credentials
    • ↳Check Open Package Routes
    • ↳Reviewing Project Documentation

Section 2: Testing

  1. βœ”What's Covered?
  2. βœ”Planning Your Testing Strategy
  3. βœ”The Benefits of Writing Tests
  4. βœ”Structuring Your Tests
    • ↳Directory Structure
    • ↳Choosing What To Test
    • ↳Test Structure
    • ↳Data Providers
  5. βœ”Writing the Tests
    • ↳Prioritising Mission-Critical Tests First
    • ↳Writing the Rest of the Tests
    • ↳Preventing Test Fatigue
  6. βœ”Testing Your UI with Laravel Dusk
    • ↳Installation
    • ↳Testing a Simple Form
    • ↳Dusk Pages and Selectors
    • ↳Running Failed Tests and Groups
  7. βœ”Creating a CI Workflow Using GitHub Actions
    • ↳Using an File
    • ↳Running the Test Suite
    • ↳Larastan
    • ↳Laravel Dusk
    • ↳Output

Section 3: Fixing

  1. βœ”What's Covered?
  2. βœ”Planning Your Testing Strategy
  3. βœ”Using an Error Reporting System
    • ↳Types of Errors
    • ↳The Benefits of an Automated Error Reporting System
    • ↳Error Reporting Using Flare
  4. βœ”Uptime Checking, Queue Monitoring and Scheduler Monitoring
    • ↳Uptime Monitoring with Oh Dear
    • ↳Scheduler Monitoring with Oh Dear
    • ↳Queue Monitoring with Oh Dear
  5. βœ”Updating PHP, Laravel and Packages
    • ↳Upgrading in Small Increments
    • ↳Automating the Upgrade Using Laravel Shift
    • ↳Planning Upgrades Early
  6. βœ”Using a Suitable Local Development Environment
  7. βœ”Using Tests to Fix Bugs
    • ↳What is Test-Driven Development
    • ↳Advantages & Disadvantages of Test-Driven Development
    • ↳Fixing a Real Bug Using Test-Driven Development
  8. βœ”Safely Removing Code
    • ↳Checking the Version Control History
    • ↳Scream Test
    • ↳Logging or Reporting the Usage
    • ↳Removing the Code with an Atomic Commit

Section 4: Improving

  1. βœ”What's Covered?
  2. βœ”Planning Your Testing Strategy
  3. βœ”Making the Most of PHP's Type System
    • ↳Using Type Hints and Return Types
    • ↳Union Types
    • ↳Type Hints and Return Types in Closures
  4. βœ”DRYing Up Your Code
  5. βœ”Refactoring Conditions
    • ↳Reducing Indented Code
    • ↳Replacing "if" and "elseif" with "match"
    • ↳Using the Null-safe operator
  6. βœ”Using Database Transactions
    • ↳Adding the Database Transactions
    • ↳Manually Using Database Transactions
    • ↳Tips for Interacting with Third-Party Services
    • ↳Using Automatic or Manual Transactions
    • ↳Dispatching Queued Jobs Inside Database Transactions
  7. βœ”Improving the Testability of Your Code
  8. βœ”Using Objects over Arrays
So, How Much Is It?

Pricing & Packages

Entire Book

The book is perfect for anyone who wants to learn how to audit, test and improve their Laravel applications.

  • Step-by-step instructions

  • Tips & Tricks

  • Actionable Advice

  • Real-world Examples

Ash Allen

Ash Allen πŸš€

Web Developer

About the Author

Hey there! My name's Ash Allen! πŸ‘‹

I'm a Laravel web developer from the UK.

I've worked with many companies from around the world to help build and improve Laravel applications that they can be proud of!

I wrote the "The Clean Coder's Guide to Laravel" which was downloaded more than 5k times, and I also have an active blog where I write about Laravel and PHP. I've also had articles published on the Laravel News and Honeybadger blogs.

I have several PHP packages (such as Short URL and Laravel Exchange Rates) which have been installed over 150k times. I also love working on other open-source projects and have contributed to the Laravel framework.

What people say about the book and my previous work


Kev Choppin

Ashley is one of the most knowledgeable and active Laravel devs in the community. His contributions to the Laravel framework alone have added a lot of value and I personally can't wait to read his new book.

Jae Toole

What a read... Whether you're a junior developer or a senior developer, anyone that reads Battle Ready Laravel will learn something new .

Nicolai Baaring

Battle Ready Laravel is a great source for strengthening your application . As a lookup or read, it's a comprehensive guide to worry-free development .


I had the pleasure of reading through Ash's Battle Ready Laravel eBook. As a Laravel Developer, one who considers himself to be intermediate to advanced, I have learnt so much more in this eBook than I've learnt by any other means. The explanations are easy to understand , the code samples are fluent and more importantly, it shows techniques and methods I never knew existed . An absolute asset to my arsenal, I would highly recommend to anyone who is yet to explore testing in Laravel, as well as those who are well versed in it. Cannot wait for his next one, absolutely well worth the price!

Ty Noryan

Ash has been responsible for several fantastic Laravel packages and blog posts. He has an innate ability to present complex concepts through clear and understandable examples . Make sure to follow him on Twitter and subscribe to his newsletter.

Stephen Rees-Carter

It's clear Ash has poured years of experience into Battle Ready Laravel. It's full of great tips and recommendations that every Laravel developer really needs to know. My personal favourite is the auditing chapter, which is a topic I wish more developers would pay attention to! So if you're looking to improve your dev skills (and even if you're not) you really need to grab a copy!

Matt Kingshott

If you’re gearing up for a launch, or you are about to dive into the challenging world of code auditing, then be sure to have Battle Ready Laravel at your side. Following its clear, comprehensive, and well-written content will leave you feeling so much more confident about your apps .

Hamza Ikram

This book is a great addition to the Laravel family. I've never seen any Laravel book as in-depth as Ash goes with Battle Ready laravel. Whatever your current developer level, if you are looking to improve your Laravel app , then this book is strongly recommendable.

Africa Gatsby

This is a complete guide that can help a middle level Laravel developer transition into a senior effectively.

Christian Olear

I'd definitely recommend your content. I'm reading a lot of it and find it really valuable .

Ganesh Ghalame

Your contents is really good , your last blog on interfaces was really nice. I’m using your package short-url, it's configurable and helpful, I'm looking forward to your book.

Doeke Norg

It's a shame this book is focused on Laravel, as the concepts and tips would benefit any developer using any framework ! After reading this, you won't be just battle-ready; you'll win!

JD Lien

Ash conveys copious experience in this book to show you what you need to know to make your Laravel applications robust, professional, and maintainable. After reading this book, I better understand many concepts that will make me a much more confident and capable Laravel developer .

Marc Hampson

Ash brings together a wealth of personal knowledge and experience for auditing and maintaining Laravel apps . As a seasoned developer, I wondered how much I’d learn. A lot! This should be required reading for anyone building or maintaining modern web apps.

Nick Wilkins

The book has a plethora of great advice and snippets that have really helped me already not only in my current projects - where I can instantly implement some tips , but also for future ones where I can start from a stronger base. Highly recommend

Alex Wulf

I am looking forward to your latest book and I’m volunteering as proof reader.

Saif ur rehman Awan

I find your content (blogs) very informative .

Frequently Asked Questions

What format is the book available in?

At the moment, the book is only available as a PDF. If there's enough interest, I may consider releasing ePub and MOBI version in the future.

Do you offer PPP or a student discount?

Yes! I do offer PPP (purchasing power parity) and a student discount. Drop me an email at and I'll provide you with a discount code that you can use.

Can I get an invoice?

Of course! As soon as you purchase the book, you'll be sent an email with the invoice.

Can I get in touch with you?

Sure! If you have any questions at all, you can get in touch with me at

πŸš€ Powered by Ash Allen Design

⚑ Analytics by Fathom Analytics

πŸ”₯ Hosted using Digital Ocean

Get Your Free Chapter!

Enter your name and email below and you'll get sent a free chapter about:

βœ… Planning your auditing strategy
βœ… Improving your code quality using Larastan


πŸ’° Save 30% on Battle Ready Laravel with the discount code: BLACKFRIDAY30

Buy Now for $27.30!