Difference between Route::resource and Route::controller

Resource controller

Route::resource which is called RESTful resource controller sets up default routes and handles the given below actions.

Verb          Path                                      Action                       Route Name

GET           /resource                                index                         resource.index

GET             /resource/create                       create                       resource.create

POST          / resource                               store                         resource.store

GET           / resource / {resource}                  show                         resource.show

GET           / resource /{ resource }/edit          edit                          resource.edit

PUT|PATCH     / resource /{ resource }          update                     resource.update

DELETE        / resource /{ resource }               destroy                     resource.destroy

In the BaseController you should create functions/methods for it.

class UsersController extends BaseController { 

    public function index() { }

    public function show($id) { }

    public function store() { }

}

php artisan controller:make ControllerName
is the command for creating a resource controller.

Implicit controllers

Laravel lets you create a single route to carry out every action in a controller.

Route::controller('users', 'UserController');

Controller method can have two arguments first the base URI the controller handles and second is the class name of the controller. You can add methods in the controller as given below.

class UserController extends BaseController {

    public function getIndex()

    {

        //your code

    } 

    public function postProfile()

    {

        //your code

    }

    public function anyLogin()

    {

        //your code

    } 

}