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

Please explain events in laravel?

671


How to get data between two dates with query in laravel?

663


Name the first file that loaded in laravel?

709


What is report method?

684


Tell me does laravel support caching?

664


Who are Manually Authenticating Users in Laravel ?

1693


What is laravel dusk?

700


How to install valet?

669


How to remove /public from url in laravel?

687


What do you know about closures in laravel?

726


How do I log an error?

664


Tell us what are advantages of laravel?

737


What is Basic Response in Laravel ?

1322


What is algolia search?

625


Tell us what are bundles, reverse routing and the ioc container?

638