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

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