How to create Creating a Controller ?



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

Post New Answer

More Laravel PHP Framework Interview Questions

Which is better django or laravel?

0 Answers  


What is console in laravel?

0 Answers  


What is a Composer command ?

0 Answers  


Which js framework is best with laravel?

0 Answers  


What is Basic Response in Laravel ?

1 Answers  


Does laravel use mvc?

0 Answers  


Explain how to install valet?

0 Answers  


How to use update query in laravel?

0 Answers  


What do you mean by bundles?

0 Answers  


How to get, set, distroy cookies in laravel?

0 Answers  


What is the use of slug in laravel?

0 Answers  


What is db facade?

0 Answers  


Categories