Answer Posted / 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 |
Post New Answer View All Answers
Explain php artisan?
What is homebrew?
Explain automatic injection in laravel?
Explain how to share your homestead with others?
What is a laravel controller?
What is helper function in laravel?
What is Laravel - Middleware ?
List types of the relationships supported by laravel?
Why middleware is used in laravel?
Explain important directories used in a common laravel application.
Please provide steps to configure homestead?
How can you update homestead?
Explain how to get requested path in laravel?
How to set login page as default page in laravel?
What is fluent query builder in laravel?