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
How to Passing Data to Views ?
What can I do with laravel?
What is illuminate in laravel?
What do you understand by reverse routing?
What is monolog library in laravel?
How to access session data?
What is validation in laravel and how it is used?
Can you update homestead? If yes, how?
How can someone turn off csrf protection for a specific route?
What do you know about facades in laravel? Explain.
What is the latest version of laravel?
How to pass custom table name in model?
Explain about laravel project?
How can you generate urls?
How to make a constant and use globally?