Challenge 2 — Solution Task: Write a composer.json defining a PSR-4 mapping for the namespace prefix "App\\" to a folder "app/". Describe in a comment which command would be run after creating/editing this file, and what it generates. ---- composer.json ---- { "autoload": { "psr-4": { "App\\": "app/" } } } ---- Notes (as would be written in a comment) ---- After creating or editing composer.json, the command to run is: composer dump-autoload This regenerates vendor/autoload.php - a single generated file that knows how to map any class name starting with "App\" (e.g. App\Models\ User, App\Services\EmailService) directly onto a file path under the app/ folder (app/Models/User.php, app/Services/EmailService.php), following the PSR-4 convention. Any PHP script can then get access to every class under the App\ namespace just by writing: require 'vendor/autoload.php'; at the top, with no manual require_once needed for any individual class file from that point onward. Notes: - The double backslash "App\\" in the JSON is required because a single backslash is JSON's own escape character - "App\\" represents the single literal backslash PHP actually uses as its namespace separator. - "app/" (with the trailing slash) tells Composer's autoloader exactly which folder on disk corresponds to the App\ namespace prefix - a class App\Models\User would be expected at app/Models/User.php. - composer dump-autoload only needs to be re-run when the autoload mapping itself changes (a new namespace prefix, a renamed folder) - adding a new class file within an already-mapped namespace/folder works immediately without re-running it, since PSR-4 computes the path from the class name rather than listing every file explicitly.