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

What is blade template?

0 Answers  


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

0 Answers  


List the requirements to install valet?

0 Answers  


Tell us have you used lumen before?

0 Answers  


How to register a middlewares in laravel controller?

0 Answers  


Explain me what directories that need to be writable laravel installation?

0 Answers  


How to Redirecting to Controller Actions in Laravel ?

1 Answers  


What is use of model in laravel?

0 Answers  


How to generate application key in laravel? Why it is neccessary?

0 Answers  


How to configure route cache in laravel?

0 Answers  


What are enhancement features in laravel 5.8?

0 Answers  


What is mass assignable in laravel?

0 Answers  


Categories