Search code examples
controllerslaravel-5.3

Customizing RegisterController.php - Laravel 5.3


I want to restrict the access to the route /register to:

if(Auth::user()->admin == 1)

However, I can't seem to find the showRegistrationForm() method in RegisterController.php as shown under Router.php in vendor\laravel\framework\src\Illuminate\Routing

Here's my RegisterController.php

http://pastebin.com/RVARcy0r


Solution

  • You have to make a method showRegistrationForm() in your controller. All these methods are defined in the Illuminate\Foundation\Auth\RegistersUsers.php.

    Also, restrict the access in the middleware.