Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Do you know what is routing and how, and what are the different ways to write it?

Answer Posted / Aman Kumar

Routing in Laravel determines how incoming requests will be handled by your application. It defines the URL patterns for your web application and specifies which controller methods should be called to respond to those requests.nnThere are several ways to define routes in Laravel, such as:nn1. Using explicit route declarations:

```
Route::get('/', 'HomeController@index');
```

2. Using route service providers:

```
use AppHttpControllersHomeController;

namespace AppProviders;

class RouteServiceProvider extends ServiceProvider
{
public void boot()
{
Route::get('/', HomeController@index);
}
}
```

3. Using the Laravel's routing helper functions:

```
use IlluminateSupportFacadesRoute;

Route::get('/', function () {
return view('home');
});
```

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell us have you used lumen before?

791


Do you know what version of laravel do you generally use?

811


What is current stable version of laravel?

842


What is latest version of laravel?

855


How much laravel experience do you have?

800