Exercise 2: route:cache Working Without Changes — Possible Solution ==================================================================== WHY route:cache WORKS HERE WITHOUT ANY CHANGES ------------------------------ Per this chapter, php artisan route:cache fails outright if any registered route is defined as a closure rather than a reference to a Controller method, since a closure can't be serialized into the compiled route cache file. Every route across this entire course has pointed at a Controller method - never a closure - so running route:cache at deployment time succeeds immediately with nothing to rewrite. WHERE THIS TRACES BACK TO ------------------------------ Per this chapter, this discipline was established explicitly back in Chapter 3, when routing was first introduced, specifically so that route:cache would work without modification once deployment was reached. The decision to always use Controller-method references instead of closures was made with this exact deployment step already in mind, several chapters before deployment was actually covered. WHY THIS WORKS AS AN ANSWER ------------------------------ It correctly explains that route:cache rejects closures and that every route in this course was written as a Controller-method reference, and correctly traces that convention back to a deliberate decision made in Chapter 3, not something arrived at accidentally.