. */ use App\Http\Controllers\Account\AccountController; use App\Http\Controllers\Account\ApiKeyController; use App\Http\Controllers\Account\CreationRequestTokenController; use App\Http\Controllers\Account\EmailController; use App\Http\Controllers\Account\PasswordController; use App\Http\Controllers\Account\PhoneController; use App\Http\Controllers\Account\ProvisioningController; use App\Http\Controllers\Account\RecoveryController; use App\Http\Controllers\Admin\AccountAccountTypeController; use App\Http\Controllers\Admin\AccountActionController; use App\Http\Controllers\Admin\AccountContactController; use App\Http\Controllers\Admin\AccountDeviceController; use App\Http\Controllers\Admin\AccountTypeController; use App\Http\Controllers\Admin\AccountController as AdminAccountController; use App\Http\Controllers\Admin\AccountImportController; use App\Http\Controllers\Admin\AccountStatisticsController; use App\Http\Controllers\Admin\ContactsListController; use App\Http\Controllers\Admin\ContactsListContactController; use App\Http\Controllers\Admin\StatisticsController; use Illuminate\Support\Facades\Route; Route::redirect('/', 'login')->name('account.home'); Route::get('documentation', 'Account\AccountController@documentation')->name('account.documentation'); Route::get('about', 'AboutController@about')->name('about'); if (config('app.web_panel')) { Route::get('login', 'Account\AuthenticateController@login')->name('account.login'); Route::post('authenticate', 'Account\AuthenticateController@authenticate')->name('account.authenticate'); Route::get('authenticate/qrcode/{token?}', 'Account\AuthenticateController@loginAuthToken')->name('account.authenticate.auth_token'); } Route::prefix('creation_token')->controller(CreationRequestTokenController::class)->group(function () { Route::get('check/{token}', 'check')->name('account.creation_request_token.check'); Route::post('validate', 'validateToken')->name('account.creation_request_token.validate'); }); Route::group(['middleware' => 'auth.digest_or_key'], function () { Route::get('provisioning/me', 'Account\ProvisioningController@me')->name('provisioning.me'); // Vcard 4.0 Route::get('contacts/vcard/{sip}', 'Account\ContactVcardController@show')->name('account.contacts.vcard.show'); Route::get('contacts/vcard', 'Account\ContactVcardController@index')->name('account.contacts.vcard.index'); }); Route::name('provisioning.')->prefix('provisioning')->controller(ProvisioningController::class)->group(function () { Route::get('documentation', 'documentation')->name('documentation'); Route::get('auth_token/{auth_token}', 'authToken')->name('auth_token'); Route::get('qrcode/{provisioning_token}', 'qrcode')->name('qrcode'); Route::get('{provisioning_token}', 'provision')->name('provision'); Route::get('/', 'show')->name('show'); }); if (publicRegistrationEnabled()) { Route::redirect('register', 'register/email')->name('account.register'); if (config('app.phone_authentication')) { Route::get('register/phone', 'Account\RegisterController@registerPhone')->name('account.register.phone'); } Route::get('register/email', 'Account\RegisterController@registerEmail')->name('account.register.email'); Route::post('accounts', 'Account\AccountController@store')->name('account.store'); } if (config('app.web_panel')) { Route::prefix('recovery')->controller(RecoveryController::class)->group(function () { Route::get('phone', 'showPhone')->name('account.recovery.show.phone'); Route::get('email', 'showEmail')->name('account.recovery.show.email'); Route::post('/', 'send')->name('account.recovery.send'); Route::post('confirm', 'confirm')->name('account.recovery.confirm'); }); Route::middleware(['auth'])->group(function () { // Email change and validation Route::prefix('email')->controller(EmailController::class)->group(function () { Route::get('change', 'change')->name('account.email.change'); Route::post('change', 'requestChange')->name('account.email.request_change'); Route::get('validate', 'validateChange')->name('account.email.validate'); Route::post('/', 'store')->name('account.email.update'); }); // Phone change and validation Route::prefix('phone')->controller(PhoneController::class)->group(function () { Route::get('change', 'change')->name('account.phone.change'); Route::post('change', 'requestChange')->name('account.phone.request_change'); Route::get('validate', 'validateChange')->name('account.phone.validate'); Route::post('/', 'store')->name('account.phone.update'); }); Route::controller(AccountController::class)->group(function () { Route::get('dashboard', 'panel')->name('account.dashboard'); Route::get('delete', 'delete')->name('account.delete'); Route::delete('delete', 'destroy')->name('account.destroy'); }); Route::get('logout', 'Account\AuthenticateController@logout')->name('account.logout'); Route::prefix('password')->controller(PasswordController::class)->group(function () { Route::get('/', 'show')->name('account.password.show'); Route::post('/', 'update')->name('account.password.update'); }); Route::prefix('api_key')->controller(ApiKeyController::class)->group(function () { Route::get('/', 'show')->name('account.api_key.show'); Route::post('/', 'update')->name('account.api_key.update'); }); Route::post('auth_tokens', 'Account\AuthTokenController@create')->name('account.auth_tokens.create'); Route::get('auth_tokens/auth/external/{token}', 'Account\AuthTokenController@authExternal')->name('auth_tokens.auth.external'); }); Route::get('auth_tokens/qrcode/{token}', 'Account\AuthTokenController@qrcode')->name('auth_tokens.qrcode'); Route::get('auth_tokens/auth/{token}', 'Account\AuthTokenController@auth')->name('auth_tokens.auth'); Route::name('admin.')->prefix('admin')->middleware(['auth.admin'])->group(function () { Route::name('statistics.')->controller(StatisticsController::class)->prefix('statistics')->group(function () { Route::get('/', 'index')->name('index'); Route::post('call_logs', 'editCallLogs')->name('edit_call_logs'); Route::get('call_logs', 'showCallLogs')->name('show_call_logs'); Route::get('/{type?}', 'show')->name('show'); Route::post('/', 'edit')->name('edit'); //Route::post('search', 'search')->name('search'); }); Route::name('account.')->prefix('accounts')->group(function () { Route::controller(AdminAccountController::class)->group(function () { Route::get('{account_id}/provision', 'provision')->name('provision'); Route::get('create', 'create')->name('create'); Route::post('accounts', 'store')->name('store'); Route::get('{account_id}/edit', 'edit')->name('edit'); Route::put('{account_id}', 'update')->name('update'); Route::get('{account_id}/delete', 'delete')->name('delete'); Route::delete('/', 'destroy')->name('destroy'); Route::get('/', 'index')->name('index'); Route::post('search', 'search')->name('search'); Route::get('{account_id}/contacts_lists/detach', 'contactsListRemove')->name('contacts_lists.detach'); Route::post('{account_id}/contacts_lists', 'contactsListAdd')->name('contacts_lists.attach'); }); Route::name('import.')->prefix('import')->controller(AccountImportController::class)->group(function () { Route::get('/', 'create')->name('create'); Route::post('/', 'store')->name('store'); Route::post('handle', 'handle')->name('handle'); }); if (config('app.intercom_features')) { Route::name('type.')->prefix('types')->controller(AccountTypeController::class)->group(function () { Route::get('/', 'index')->name('index'); Route::get('create', 'create')->name('create'); Route::post('/', 'store')->name('store'); Route::get('{type_id}/edit', 'edit')->name('edit'); Route::put('{type_id}', 'update')->name('update'); Route::get('{type_id}/delete', 'delete')->name('delete'); Route::delete('{type_id}', 'destroy')->name('destroy'); }); Route::name('account_type.')->prefix('{account}/types')->controller(AccountAccountTypeController::class)->group(function () { Route::get('create', 'create')->name('create'); Route::post('/', 'store')->name('store'); Route::delete('{type_id}', 'destroy')->name('destroy'); }); Route::name('action.')->prefix('{account}/actions')->controller(AccountActionController::class)->group(function () { Route::get('create', 'create')->name('create'); Route::post('/', 'store')->name('store'); Route::get('{action_id}/edit', 'edit')->name('edit'); Route::put('{action_id}', 'update')->name('update'); Route::get('{action_id}/delete', 'delete')->name('delete'); Route::delete('{action_id}', 'destroy')->name('destroy'); }); } Route::name('contact.')->prefix('{account}/contacts')->controller(AccountContactController::class)->group(function () { Route::get('create', 'create')->name('create'); Route::post('/', 'store')->name('store'); Route::get('{contact_id}/delete', 'delete')->name('delete'); Route::delete('/', 'destroy')->name('destroy'); }); Route::name('device.')->prefix('{account}/devices')->controller(AccountDeviceController::class)->group(function () { Route::get('/', 'index')->name('index'); Route::get('{device_id}/delete', 'delete')->name('delete'); Route::delete('/', 'destroy')->name('destroy'); }); Route::name('statistics.')->prefix('{account}/statistics')->controller(AccountStatisticsController::class)->group(function () { Route::get('/', 'show')->name('show'); Route::post('call_logs', 'editCallLogs')->name('edit_call_logs'); Route::get('call_logs', 'showCallLogs')->name('show_call_logs'); Route::post('/', 'edit')->name('edit'); }); }); Route::name('contacts_lists.')->prefix('contacts_lists')->controller(ContactsListController::class)->group(function () { Route::get('/', 'index')->name('index'); Route::get('create', 'create')->name('create'); Route::post('/', 'store')->name('store'); Route::post('{contacts_list_id}/search', 'search')->name('search'); Route::get('{contacts_list_id}/edit', 'edit')->name('edit'); Route::put('{contacts_list_id}', 'update')->name('update'); Route::get('{contacts_list_id}/delete', 'delete')->name('delete'); Route::delete('{contacts_list_id}', 'destroy')->name('destroy'); Route::name('contacts.')->prefix('{contacts_list_id}/contacts')->controller(ContactsListContactController::class)->group(function () { Route::get('add', 'add')->name('add'); Route::post('search', 'search')->name('search'); Route::post('/', 'store')->name('store'); Route::delete('/', 'destroy')->name('destroy'); }); }); }); }