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 laravel api?
What is laravel language?
Explain short notes on Laravel - Artisan Console and commands ?
What are laravel contract’s?
How to use update statement in laravel?
How x-csrf-token is different from csrf tokens?
Explain how to bind a service container to a service provide?
What are class traits?
Where do you locate route files?
How to use skip() and take() in laravel query?
How to install mysql on valet?
What is route model binding?