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?



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

Answer / 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

More Laravel PHP Framework Interview Questions

How can we check the laravel current version?

1 Answers  


What is meant by Forms in Laravel ?

2 Answers  


How to launch vagrant box?

1 Answers  


What is php artisan.

1 Answers  


what is meant by Views ?

2 Answers  


What is the difference between facades vs helper functions?

1 Answers  


What is view laravel?

1 Answers  


What are http exceptions?

1 Answers  


How to remove /public from url in laravel?

1 Answers  


Define homebrew?

1 Answers  


What is boot method in laravel?

1 Answers  


How to register a middleware in laravel?

1 Answers  


Categories