In plain PHP, courses.php is a URL. In Laravel every request enters through public/index.php and the router decides what runs.
// routes/web.php
Route::get('/courses', [CourseController::class, 'index']);
Route::get('/courses/{slug}', [CourseController::class, 'show']);
Route::post('/courses', [CourseController::class, 'store'])->middleware('auth');class CourseController extends Controller
{
public function index()
{
$courses = Course::where('is_published', true)->get();
return view('courses.index', compact('courses'));
}
}routes/web.php, URLsapp/Http/Controllers/, request handlingapp/Models/, database tablesresources/views/, Blade templatesdatabase/migrations/, schema history.env. Credentials, never committedYour code, config and .env sit ABOVE the web root and cannot be requested by URL. That structural separation is worth a great deal on its own.
Route::get('/courses/{slug}', ...)->name('courses.show');
// then: route('courses.show', $course->slug)Change the URL later and every link updates itself.