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 ?



Explain Constructor Injection ?..

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

More Laravel PHP Framework Interview Questions

Explain facades in laravel?

0 Answers  


What do you mean by eloquent used in laravel 5?

0 Answers  


What do you mean by dusk used in laravel 5?

0 Answers  


How to share data with views?

0 Answers  


How to work with an Error in Laravel ?

1 Answers  


List the default ports that are forwarded to your homestead environment?

0 Answers  


How do I use eloquent to get a list of comments with one author each avoiding n+1 queries?

0 Answers  


What is database migration? And how to use it to add insert initial data to database?

0 Answers  


Do you know validations in laravel?

0 Answers  


How to serve sites on valet?

0 Answers  


What is eager loading in laravel?

0 Answers  


How to register a service provider via composer in laravel?

0 Answers  


Categories