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
How to Accessing Session Data in Laravel ?
How to create Facade in Laravel ?
What is a laravel model?
Explain how to add additional sites in homestead environment?
Tell me why laravel over other php frameworks?
How to use multiple or condition in laravel query?
what is meant by Views ?
What is the use of accessors and mutators in eloquent?
What is csrf protection?
How to register a service provider via composer in laravel?
What do you call a single quote?
What is bearer token?
Explain how to serve sites on valet?
How do I add a 3rd party package to your application like laravel-emoji?
What are advantages of laravel?