how to create controller in laravel through cmd?

Today, We want to share with you how to create controller in laravel.In this post we will show you laravel resource controller example, hear for how to creates controller in laravel through cmd we will give you demo and example for implement.In this post, we will learn about How to creates Controller in Laravel? with an example.

How to creates Controller in Laravel using Artisan Command?

php artisan make:controller DemoController


You can easily connect route with controller as like bellow:


Route::get('demo', 'DemoController@index');


You can also creates controller with invokable controller using bellow command:

php artisan make:controller ShowProfile --invokable


I hope you get an idea about laravel register controller.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment