app, bootstrap and config
Open a fresh Laravel project and you see about a dozen folders. Three of them decide how the app is built and how it behaves: app/ for your classes, bootstrap/ for starting the app, and config/ for settings. Put things in the right one and Laravel finds them without being told.
The rule
app/ is your code, bootstrap/ starts it, config/ tunes it.
app/: your own PHP classes. Everything here uses the App\ namespace, so app/Models/Book.php is App\Models\Book.
app/Models/: Eloquent models, such asUserandBookapp/Http/Controllers/: controllersapp/Providers/: service providers, such asAppServiceProvider
More folders, such as app/Jobs or app/Policies, appear when you generate those classes with Artisan.
bootstrap/: building the app.
bootstrap/app.php: routing, middleware and exception setupbootstrap/providers.php: the list of service providers to loadbootstrap/cache/: files Laravel generates to start faster. Never edit them.
config/: settings, one file per area, such as app.php, database.php, mail.php and session.php. Each file returns an array, and values that change per machine are pulled from .env:
// config/lendly.php
return [
'loan_days' => env('LOAN_DAYS', 14),
];Code reads settings with dot notation, file name first:
$days = config('lendly.loan_days'); // 14 unless .env says otherwiseSome config files are hidden in a new app to keep it small. php artisan config:publish copies them in when you need to change one.