Introduction to RESTful API and resourceful URLs

In this tutorial we’ll try to make a brief introduction to one of the main components of Laravel and a widely-used software architecture among modern PHP Frameworks and applications.

Resourceful urls make your website more friendly to Search Engines and look more cleaner (they are often called “clean URLs”).

Laravel has its own syntax for creating and describing such paths (or so called routes) in a easy manner.

There is a configuration file in app/routes.php in which you can define the routes of your application and the resources to which they lead.

By default it contains the following route:

cPanel Hosting from WebhostFace

Route::get(‘/’, function()
{
return View::make(‘hello’);
});

This instance of the Route class displays the default “Welcome” page in the root of your Laravel installation.

For example you can add this route to display your user registration page after creating one:

Route::get(‘/register’, function()
{
return View::make(‘register’);
});

You can create different HTML pages with the Blade template system which is part of Laravel but Blades are a different topic. 🙂

was this knowledge base article useful to you