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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners