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
What is observer in laravel?
What is the laravel?
How can we use middleware in laravel?
List server requirements for installing laravel 5.5?
What is the laravel framework?
What is composer lock in laravel?
How to install and start, stop mysql on valet?
Describe laravel service provider?
Explain me what is your favorite feature of laravel?
Explain the events in laravel?
How will you explain homestead in laravel?
What are the benefits of facades?
How do I add a 3rd party package to your application like laravel-emoji?
Tell me what are system requirement for laravel 5.0?
List out the plateforms laravel homestead supports?