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 |
Which template engine laravel use?
How to configure clear route cache in laravel?
Explain how to do 301 redirects in laravel?
What is a check method ?
Do you know what is php artisan.
What are view composers?
How to install laravel via laravel installer.
What is Laravel - File Uploading ?
How to use delete statement in laravel?
How can we handle Error Handling in Laravel ?
How will you explain guarded attribute in a laravel model?
What is blade template engine?