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 explain events in laravel?
How to get data between two dates with query in laravel?
Name the first file that loaded in laravel?
What is report method?
Tell me does laravel support caching?
Who are Manually Authenticating Users in Laravel ?
What is laravel dusk?
How to install valet?
How to remove /public from url in laravel?
What do you know about closures in laravel?
How do I log an error?
Tell us what are advantages of laravel?
What is Basic Response in Laravel ?
What is algolia search?
Tell us what are bundles, reverse routing and the ioc container?