Feb 15, 2018

How to create controller using artisan syntax in Laravel 5

We know, Laravel framework is current technology trend. I am facing the issue to create controller in laravel 5.

When I was following along with Learning Laravel 4 Application Development

I attempt to create my first controller with artisan by doing the following:

 
php artisan Usercontroller:make users
But when I did for Larvel 5 application controller, getting an error:
 
  [InvalidArgumentException]                                        
  There are no commands defined in the "Usercontroller" namespace.  

  Did you mean this?                                                
      controller 
What is happening here?

Because of above mention artisan use for the Larvel 4 and not for Larvel 5.

So there is the way in Laravel 4, but in Laravel 5 you should use it backwards php artisan

Solution for controller creation in Laravel 5.

 
php artisan make:controller Usercontroller

Hope it will help to you to controller creation in Laravel 5 application.

No comments:

Post a Comment