<?php

use Illuminate\Support\Facades\Route;

Route::group(['prefix' => 'account', 'namespace' => 'Account', 'as' => 'account.'], function () {

    Route::group(['prefix' => 'authentication', 'as' => 'authentication.'], function () {

        Route::group(['prefix' => 'login', 'as' => 'authenticate.'], function () {
            Route::post('/attempt', 'UserAuthenticationController@authenticate')->name('attempt');
            Route::post('/check_email', 'CheckEmailController@check')->name('email.check');
        });

        Route::group(['prefix' => 'password', 'as' => 'password.'], function () {
            Route::post('/forget', 'GeneratePasswordResetController@generate')->name('forget');
            Route::post('/reset', 'ResetPasswordController@reset')->name('reset');
        });

        Route::post('/registration', 'CreateUserController@create')->name('registration');

    });

    Route::group(['prefix' => 'user', 'as' => 'user.'], function () {
        Route::get('list', 'ListUsersController@list')->name('list');
    });

});