How to create Creating a Controller ?
Answer / sunil kumar
Open the terminal based on the operating system you are using and type the following command to create controller using the Artisan CLI (Command Line Interface).
Syntax : Route::get(‘base URI’,’controller@method’);
Example : php artisan make:controller <controller-name> --plain
It describes above example Replace the <controller-name> with the name of your controller.
This will create a plain constructor as we are passing the argument — plain.
If you don’t want to create a plain constructor, you can simply ignore the argument.
The created constructor can be seen at app/Http/Controllers.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the difference between {{ $username }} and {!! $Username !!} In laravel?
What does valet park?
How can you reduce memory usage in laravel?
Explain how to create custom middleware in laravel?
How to get current action name in laravel?
What are guards in laravel?
How to make a constant and use globally?
What is dependency injection laravel?
Where laravel’s facades are defined?
Which template engine is used by laravel?
Differce between contracts and facades?
What is a recursive helper function?