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
What is namespace in php laravel?
What is reverse path filtering?
What is the significant difference between insert() and insertgetid() function in laravel?
Can we assign multiple middlewares to a route.
What is meant by Laravel - Hashing ?
How to check table is exists or not in our database using laravel?
What is blade in laravel?
List out the databases laravel supports?
What is register method?
What are Global Middleware and Route Middleware ?
How can you retrieve values for laravel configration files.
Explain binding instances?
How to change your default database type in laravel?
How do I register a middleware?
What does xss stand for?