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 use of in laravel?
Why are migrations necessary?
Tell me how can you display html with blade in laravel?
What is a Views ?
What is laravel boilerplate?
Explain me what directories that need to be writable laravel installation?
Explain binding primitives?
What is an observer?
How to work with an Error in Laravel ?
Tell me how to set database connection in laravel?
How to use multiple or condition in laravel query?
What is Terminable Middleware ?