Explain Constructor Injection ?
Answer / 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 |
Do you know what developed the laravel?
How can we get the user's ip address in laravel?
What is mvc framework laravel?
Tell me what is laravel eloquent?
What is bootstrap software development?
What is route in laravel?
List out the plateforms laravel homestead supports?
How to generate & update application key in laravel 5?
What is automatic injection in laravel?
What is dependency injection in laravel?
How to use ajax in any form submission?
Is laravel an mvc framework?