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...

Explain Constructor Injection ?

Answer Posted / rachana devi

The Laravel service container is used to resolve all Laravel controllers.
As a result, you are able to type-hint any dependencies your controller may need in its constructor.
The dependencies will automatically be resolved and injected into the controller instance.

Example :

class MyClass
{
public $foo = 'bar';
}
Route::get('/myclass','ImplicitController@index');


we have to Add the following code to app/Http/routes.php file. "app/Http/routes.php".

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is observer in laravel?

731


What is the laravel?

698


How can we use middleware in laravel?

716


List server requirements for installing laravel 5.5?

791


What is the laravel framework?

687


What is composer lock in laravel?

707


How to install and start, stop mysql on valet?

714


Describe laravel service provider?

733


Explain me what is your favorite feature of laravel?

697


Explain the events in laravel?

804


How will you explain homestead in laravel?

693


What are the benefits of facades?

713


How do I add a 3rd party package to your application like laravel-emoji?

682


Tell me what are system requirement for laravel 5.0?

761


List out the plateforms laravel homestead supports?

682