Reputation: 1213
Let's say I have a UsersController
. In that controller there is a handler for website.com/users/login
and website.com/users/register
How would I handle a route of website.com/users
within the controller similarly how I would with the other handlers?
Upvotes: 0
Views: 1163
Reputation: 3658
In routes.php:
Route::controller('users', 'UserController');
In UserController.php:
class UserController extends BaseController {
public function getIndex()
{
# GET website.com/users
}
public function getLogin()
{
# GET website.com/users/login
}
public function getRegister()
{
# GET website.com/users/register
}
}
The Laravel docs have more examples: http://four.laravel.com/docs/routing
Upvotes: 1