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 eloquent model?
How to generate application key in laravel?
Tell me what are pros and cons of using laravel framework?
How auth is used?
What are the Forms in Laravel ?
List some features of laravel 5.0?
What is system requirement for installation of laravel 5.2 (latest version)?
What are enhancement features in laravel 5.8?
How to start valet?
What getfacadeaccessor method does?
What is a Laravel - Contracts ?
What is an observer in laravel?
What is x-csrf-token?
What is a check method ?
Does laravel passport use jwt?