for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Signifly\Janitor;
use Illuminate\Contracts\Routing\Registrar as Router;
class RouteRegistrar
{
/**
* The router implementation.
*
* @var \Illuminate\Contracts\Routing\Registrar
*/
protected $router;
public function __construct(Router $router)
$this->router = $router;
}
* Apply all routes to the router.
* @return void
public function all()
$this->forAuthentication();
$this->forPasswordReset();
* Apply authentication routes to the router.
public function forAuthentication()
$this->router->post('login', 'AuthController@login')
->name('login');
$this->router->post('login/refresh', 'AuthController@refresh')
->name('refresh');
$this->router->group(['middleware' => ['auth:api']], function ($router) {
$router->post('logout', 'AuthController@logout')
->name('logout');
});
* Apply password reset routes to the router.
public function forPasswordReset()
$this->router->post('password/email', 'ResetPasswordController@sendResetLinkEmail')
->name('password.email');
$this->router->post('password/reset', 'ResetPasswordController@reset')
->name('password.reset');