You can download the source code for this tutorial here: https://www.ericsdevblog.com/index.php/beginners-roadmap-to-web-development/ In Laravel, the routes are defined in the routes folder.

Go to routes/web.php, and we can see there is already a pre-defined route: use Illuminate\Support\Facades\Route; Route::get('/', function () { return view('welcome'); }); Enter fullscreen mode This piece of code means when the Laravel route receives "/", it returns a view called "welcome", which is located at resources/views/welcome.blade.php.

Route::match(['get', 'post'], '/', function () { // }); Route::any('/', function () { // }); Enter fullscreen mode #pass-data-to-view Pass Data to View
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners