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

How to Accessing Session Data in Laravel ?

1373


How to create Facade in Laravel ?

1473


What is a laravel model?

717


Explain how to add additional sites in homestead environment?

683


Tell me why laravel over other php frameworks?

687


How to use multiple or condition in laravel query?

636


what is meant by Views ?

1355


What is the use of accessors and mutators in eloquent?

621


What is csrf protection?

728


How to register a service provider via composer in laravel?

668


What do you call a single quote?

678


What is bearer token?

682


Explain how to serve sites on valet?

651


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

637


What are advantages of laravel?

713