database, storage, tests and vendor
Four folders remain, and each answers a different question. Where is the shape of my data? Where does the app write files? Where do I prove it works? Where is everyone else's code? Mix them up and you end up committing gigabytes of packages or losing a member's uploaded photo.
The rule
database/ shapes data, storage/ collects output, tests/ proves it, vendor/ borrows.
database/
migrations/: PHP files that create and change tables, run withphp artisan migrate.factories/: recipes for fake rows, used in tests and seeding.seeders/: code that fills tables with starting data, run withphp artisan db:seed.database.sqlite: the database file itself, when you use SQLite.
storage/: what the running app writes.
storage/app/: files your code saves.storage/app/publicis for files the public should see, such as avatars.storage/framework/: compiled views, cache files and sessions.storage/logs/laravel.log: the log, and the first place to look when a page errors.
Uploaded files in storage/app/public are not reachable until you run:
php artisan storage:linkThat creates a public/storage link, so storage/app/public/avatars/ana.jpg is served at /storage/avatars/ana.jpg.
tests/
tests/Feature/: tests that send requests through the app, such as "GET /books returns 200".tests/Unit/: tests of one small class on its own.
Run them with php artisan test.
vendor/: every Composer package, including Laravel itself in vendor/laravel/framework. It is listed in .gitignore, and composer install rebuilds it from composer.lock.