moey
moey

Reputation: 10907

Laravel: RESTful controller

If you had defined a RESTful controller in routes.php

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

and the following functions in the UserController class

public function getLogin() { ... }
public function postLogin() { ... }

Do we even need to define Route::post('user/login', 'UserController@postLogin') anymore?

Upvotes: 0

Views: 62

Answers (1)

Laurence
Laurence

Reputation: 60088

Do we even need to define Route::post('user/login', 'UserController@postLogin') anymore?

No - because the RESTful controller route includes that.

You can test this by running php artisan routes to see a list of all registered routes in your application.

Upvotes: 1

Related Questions