Source: www.ericsdevblog.com

Laravel Tutorial #2: Route and Middleware
In this article, we’ll take a look at Laravel’s route and middleware. In Laravel, the routes are defined in the routes folder.

use Illuminate\Support\Facades\Route; Route::get('/', function () { return view('welcome'); }); We first import the Route class, and invoked the get() method.

There are other methods built into the Route class that allows us to match any other HTTP request methods.

You may specify a name for a route by chaining the name method onto the route definition.
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