Laravel Routing Tutorial: GET, POST, and Route Parameters
Learn Laravel routing from scratch — define GET and POST routes, pass parameters, name your routes, and organize routes with groups.
Routing is how Laravel decides what code to run when someone visits a specific URL. This tutorial covers everything a beginner needs to define and manage routes confidently. Where Routes Live Web routes are defined in routes/web.php . Every route maps a URL to a response — either directly, or via a controller. Your First Route Route::get('/', function () { return 'Hello, Laravel!'; }); Visit http://127.0.0.1:8000/ and you'll see "Hello, Laravel!" on screen. Returning a View Instead of Text Route::get('/about', function () { return view('about'); }); This looks for a file at resources/views/about.blade.php and renders it. GET vs POST Routes GET – used for retrieving/displaying data (visiting a page) POST – used for submitting data (like a form) Route::get('/contact', function () { return view('contact'); }); Route::post('/contact', function () { // handle form submission }); Every POST...
Home · Projects · Articles · Developer tools · Contact