snipe-it/routes/web.php

458 lines
15 KiB
PHP
Raw Normal View History

2016-03-25 01:18:05 -07:00
<?php
2017-01-13 00:13:57 -08:00
2021-06-10 13:17:14 -07:00
use App\Http\Controllers\Account;
use App\Http\Controllers\ActionlogController;
use App\Http\Controllers\Auth;
2021-06-10 13:19:27 -07:00
use App\Http\Controllers\CategoriesController;
use App\Http\Controllers\CompaniesController;
2021-06-10 13:17:14 -07:00
use App\Http\Controllers\DashboardController;
2021-06-10 13:19:27 -07:00
use App\Http\Controllers\DepartmentsController;
use App\Http\Controllers\DepreciationsController;
2021-06-10 13:17:14 -07:00
use App\Http\Controllers\GroupsController;
use App\Http\Controllers\HealthController;
use App\Http\Controllers\ImportsController;
use App\Http\Controllers\LocationsController;
use App\Http\Controllers\ManufacturersController;
use App\Http\Controllers\ModalController;
use App\Http\Controllers\ProfileController;
use App\Http\Controllers\ReportsController;
use App\Http\Controllers\SettingsController;
2021-06-10 13:19:27 -07:00
use App\Http\Controllers\StatuslabelsController;
use App\Http\Controllers\SuppliersController;
2021-06-10 13:17:14 -07:00
use App\Http\Controllers\ViewAssetsController;
use Illuminate\Support\Facades\Route;
Route::group(['middleware' => 'auth'], function () {
2017-05-22 21:31:47 -07:00
/*
* Companies
*/
2021-06-10 13:17:14 -07:00
Route::resource('companies', CompaniesController::class, [
'parameters' => ['company' => 'company_id'],
2017-05-22 21:31:47 -07:00
]);
/*
* Categories
*/
2021-06-10 13:17:14 -07:00
Route::resource('categories', CategoriesController::class, [
'parameters' => ['category' => 'category_id'],
2017-05-22 21:31:47 -07:00
]);
/*
* Locations
*/
2021-06-10 13:17:14 -07:00
Route::resource('locations', LocationsController::class, [
'parameters' => ['location' => 'location_id'],
2017-05-22 21:31:47 -07:00
]);
2019-03-09 00:14:24 -08:00
Route::get(
2019-05-03 05:22:05 -07:00
'locations/{locationId}/printassigned',
2021-06-10 13:17:14 -07:00
['as' => 'locations.print_assigned', 'uses' => [LocationsController::class, 'print_assigned']]
2019-03-09 00:14:24 -08:00
);
2019-03-09 00:14:24 -08:00
Route::get(
2019-05-03 05:22:05 -07:00
'locations/{locationId}/printallassigned',
2021-06-10 13:17:14 -07:00
['as' => 'locations.print_all_assigned', 'uses' => [LocationsController::class, 'print_all_assigned']]
2019-03-09 00:14:24 -08:00
);
2017-05-22 21:31:47 -07:00
/*
* Manufacturers
*/
Route::group(['prefix' => 'manufacturers', 'middleware' => ['auth']], function () {
2021-06-10 13:17:14 -07:00
Route::get('{manufacturers_id}/restore', ['as' => 'restore/manufacturer', 'uses' => [ManufacturersController::class, 'restore']]);
});
2021-06-10 13:17:14 -07:00
Route::resource('manufacturers', ManufacturersController::class, [
'parameters' => ['manufacturer' => 'manufacturers_id'],
2017-05-22 21:31:47 -07:00
]);
/*
* Suppliers
*/
2021-06-10 13:17:14 -07:00
Route::resource('suppliers', SuppliersController::class, [
'parameters' => ['supplier' => 'supplier_id'],
2017-05-22 21:31:47 -07:00
]);
/*
* Depreciations
*/
2021-06-10 13:17:14 -07:00
Route::resource('depreciations', DepreciationsController::class, [
'parameters' => ['depreciation' => 'depreciation_id'],
2017-05-22 21:31:47 -07:00
]);
/*
* Status Labels
*/
2021-06-10 13:17:14 -07:00
Route::resource('statuslabels', StatuslabelsController::class, [
'parameters' => ['statuslabel' => 'statuslabel_id'],
2017-05-22 21:31:47 -07:00
]);
/*
* Departments
*/
2021-06-10 13:17:14 -07:00
Route::resource('departments', DepartmentsController::class, [
'parameters' => ['department' => 'department_id'],
2017-05-22 21:31:47 -07:00
]);
});
/*
|
|--------------------------------------------------------------------------
| Re-Usable Modal Dialog routes.
|--------------------------------------------------------------------------
|
| Routes for various modal dialogs to interstitially create various things
|
*/
Route::group(['middleware' => 'auth', 'prefix' => 'modals'], function () {
2021-06-10 13:17:14 -07:00
Route::get('{type}/{itemId?}', ['as' => 'modal.show', 'uses' => [ModalController::class, 'show']]);
});
2017-01-13 00:13:57 -08:00
/*
|--------------------------------------------------------------------------
| Log Routes
|--------------------------------------------------------------------------
|
| Register all the admin routes.
|
*/
Route::group(['middleware' => 'auth'], function () {
Route::get(
'display-sig/{filename}',
[
'as' => 'log.signature.view',
2021-06-10 13:17:14 -07:00
'uses' => [ActionlogController::class, 'displaySig'], ]
);
});
2016-03-25 01:18:05 -07:00
/*
|--------------------------------------------------------------------------
| Admin Routes
|--------------------------------------------------------------------------
|
| Register all the admin routes.
|
*/
Route::group(['prefix' => 'admin', 'middleware' => ['auth', 'authorize:superuser']], function () {
2021-06-10 13:17:14 -07:00
Route::get('settings', ['as' => 'settings.general.index', 'uses' => [SettingsController::class, 'getSettings']]);
Route::post('settings', ['as' => 'settings.general.save', 'uses' => [SettingsController::class, 'postSettings']]);
2016-03-25 01:18:05 -07:00
2021-06-10 13:17:14 -07:00
Route::get('branding', ['as' => 'settings.branding.index', 'uses' => [SettingsController::class, 'getBranding']]);
Route::post('branding', ['as' => 'settings.branding.save', 'uses' => [SettingsController::class, 'postBranding']]);
2016-08-02 00:54:38 -07:00
2021-06-10 13:17:14 -07:00
Route::get('security', ['as' => 'settings.security.index', 'uses' => [SettingsController::class, 'getSecurity']]);
Route::post('security', ['as' => 'settings.security.save', 'uses' => [SettingsController::class, 'postSecurity']]);
2016-03-25 01:18:05 -07:00
2021-06-10 13:17:14 -07:00
Route::get('groups', ['as' => 'settings.groups.index', 'uses' => [GroupsController::class, 'index']]);
2016-07-13 05:50:40 -07:00
2021-06-10 13:17:14 -07:00
Route::get('localization', ['as' => 'settings.localization.index', 'uses' => [SettingsController::class, 'getLocalization']]);
Route::post('localization', ['as' => 'settings.localization.save', 'uses' => [SettingsController::class, 'postLocalization']]);
2016-07-13 05:50:40 -07:00
2021-06-10 13:17:14 -07:00
Route::get('notifications', ['as' => 'settings.alerts.index', 'uses' => [SettingsController::class, 'getAlerts']]);
Route::post('notifications', ['as' => 'settings.alerts.save', 'uses' => [SettingsController::class, 'postAlerts']]);
2016-03-25 01:18:05 -07:00
2021-06-10 13:17:14 -07:00
Route::get('slack', ['as' => 'settings.slack.index', 'uses' => [SettingsController::class, 'getSlack']]);
Route::post('slack', ['as' => 'settings.slack.save', 'uses' => [SettingsController::class, 'postSlack']]);
2016-07-13 05:50:40 -07:00
2021-06-10 13:17:14 -07:00
Route::get('asset_tags', ['as' => 'settings.asset_tags.index', 'uses' => [SettingsController::class, 'getAssetTags']]);
Route::post('asset_tags', ['as' => 'settings.asset_tags.save', 'uses' => [SettingsController::class, 'postAssetTags']]);
2016-07-13 05:50:40 -07:00
2021-06-10 13:17:14 -07:00
Route::get('barcodes', ['as' => 'settings.barcodes.index', 'uses' => [SettingsController::class, 'getBarcodes']]);
Route::post('barcodes', ['as' => 'settings.barcodes.save', 'uses' => [SettingsController::class, 'postBarcodes']]);
2016-03-25 01:18:05 -07:00
2021-06-10 13:17:14 -07:00
Route::get('labels', ['as' => 'settings.labels.index', 'uses' => [SettingsController::class, 'getLabels']]);
Route::post('labels', ['as' => 'settings.labels.save', 'uses' => [SettingsController::class, 'postLabels']]);
2016-03-25 01:18:05 -07:00
2021-06-10 13:17:14 -07:00
Route::get('ldap', ['as' => 'settings.ldap.index', 'uses' => [SettingsController::class, 'getLdapSettings']]);
Route::post('ldap', ['as' => 'settings.ldap.save', 'uses' => [SettingsController::class, 'postLdapSettings']]);
2016-03-25 01:18:05 -07:00
2021-06-10 13:17:14 -07:00
Route::get('phpinfo', ['as' => 'settings.phpinfo.index', 'uses' => [SettingsController::class, 'getPhpInfo']]);
2016-03-25 01:18:05 -07:00
2021-06-10 13:17:14 -07:00
Route::get('oauth', ['as' => 'settings.oauth.index', 'uses' => [SettingsController::class, 'api']]);
2017-07-07 23:44:48 -07:00
2021-06-10 13:17:14 -07:00
Route::get('purge', ['as' => 'settings.purge.index', 'uses' => [SettingsController::class, 'getPurge']]);
Route::post('purge', ['as' => 'settings.purge.save', 'uses' => [SettingsController::class, 'postPurge']]);
2017-07-07 23:44:48 -07:00
2021-06-10 13:17:14 -07:00
Route::get('login-attempts', ['as' => 'settings.logins.index', 'uses' => [SettingsController::class, 'getLoginAttempts']]);
2017-07-07 23:44:48 -07:00
// Backups
Route::group(['prefix' => 'backups', 'middleware' => 'auth'], function () {
2017-07-07 23:44:48 -07:00
Route::get('download/{filename}', [
'as' => 'settings.backups.download',
2021-06-10 13:17:14 -07:00
'uses' => [SettingsController::class, 'downloadFile'], ]);
2017-07-07 23:44:48 -07:00
Route::delete('delete/{filename}', [
'as' => 'settings.backups.destroy',
2021-06-10 13:17:14 -07:00
'uses' => [SettingsController::class, 'deleteFile'], ]);
2017-07-07 23:44:48 -07:00
Route::post('/', [
'as' => 'settings.backups.create',
2021-06-10 13:17:14 -07:00
'uses' => [SettingsController::class, 'postBackups'],
2017-07-07 23:44:48 -07:00
]);
2021-06-10 13:17:14 -07:00
Route::get('/', ['as' => 'settings.backups.index', 'uses' => [SettingsController::class, 'getBackups']]);
2016-03-25 01:18:05 -07:00
});
2021-06-10 13:17:14 -07:00
Route::resource('groups', GroupsController::class, [
2017-10-17 21:43:57 -07:00
'middleware' => ['auth'],
'parameters' => ['group' => 'group_id'],
2017-10-17 21:43:57 -07:00
]);
2017-07-07 23:44:48 -07:00
2021-06-10 13:17:14 -07:00
Route::get('/', ['as' => 'settings.index', 'uses' => [SettingsController::class, 'index']]);
2016-03-25 01:18:05 -07:00
});
Importer mapping - v1 (#3677) * Move importer to an inline-template, allows for translations and easier passing of data from laravel to vue. * Pull the modal out into a dedicated partial, move importer to views/importer. * Add document of CSV->importer mappings. Reorganize some code. Progress. * Add header_row and first_row to imports table, and process upon uploading a file * Use an expandable table row instead of a modal for import processing. This should allow for field mapping interaction easier. * Fix import processing after moving method. * Frontend importer mapping improvements. Invert display so we show found columns and allow users to select an importer field to map to. Also implement sample data based on first row of csv. * Update select2. Maintain selected items properly. * Backend support for importing. Only works on the web importer currently. Definitely needs testing and polish. * We no longer use vue-modal plugin. * Add a column to track field mappings to the imports table. * Cleanup/rename methods+refactor * Save field mappings and import type when attempting an import, and repopulate these values when returning to the page. * Update debugbar to fix a bug in the debugbar code. * Fix asset tag detection. Also rename findMatch to be a bit clearer as to what it does. Remove logging to file of imports for http imports because it eats an incredible amouint of memory. This commit also moves imports out of the hardware namespace and into their own webcontroller and route prefix, remove dead code from AssetController as a result. * Dynamically limit options for select2 based on import type selected, and group them by item type. * Add user importer. Still need to implement emailing of passwords to new users, and probably test a bit more. This also bumps the memory limit for web imports up as well, I need to profile memory usage here before too long. * Query the db to find user matches rather than search the array. Performance is much much better. * Speed/memory improvements in importers. Move to querying the db rather than maintaining an array for all importers. Also only store the id of items when we import, rather than the full model. It saves a decent amount of memory. * Remove grouping of items in select2 With the values being set dynamically, the grouping is redundant. It also caused a regression with automatically guessing/matching field names. This is starting to get close. * Remove debug line on every create. * Switch migration to be text field instead of json field for compatibility with older mysql/mariadb * Fix asset import regression matching email address. * Rearrange travis order in attempt to fix null settings. * Use auth::id instead of fetching it off the user. Fixes a null object reference during seeding.
2017-06-21 16:37:37 -07:00
/*
|--------------------------------------------------------------------------
| Importer Routes
|--------------------------------------------------------------------------
|
|
|
*/
Route::group(['prefix' => 'import', 'middleware' => ['auth']], function () {
Route::get('/', [
Importer mapping - v1 (#3677) * Move importer to an inline-template, allows for translations and easier passing of data from laravel to vue. * Pull the modal out into a dedicated partial, move importer to views/importer. * Add document of CSV->importer mappings. Reorganize some code. Progress. * Add header_row and first_row to imports table, and process upon uploading a file * Use an expandable table row instead of a modal for import processing. This should allow for field mapping interaction easier. * Fix import processing after moving method. * Frontend importer mapping improvements. Invert display so we show found columns and allow users to select an importer field to map to. Also implement sample data based on first row of csv. * Update select2. Maintain selected items properly. * Backend support for importing. Only works on the web importer currently. Definitely needs testing and polish. * We no longer use vue-modal plugin. * Add a column to track field mappings to the imports table. * Cleanup/rename methods+refactor * Save field mappings and import type when attempting an import, and repopulate these values when returning to the page. * Update debugbar to fix a bug in the debugbar code. * Fix asset tag detection. Also rename findMatch to be a bit clearer as to what it does. Remove logging to file of imports for http imports because it eats an incredible amouint of memory. This commit also moves imports out of the hardware namespace and into their own webcontroller and route prefix, remove dead code from AssetController as a result. * Dynamically limit options for select2 based on import type selected, and group them by item type. * Add user importer. Still need to implement emailing of passwords to new users, and probably test a bit more. This also bumps the memory limit for web imports up as well, I need to profile memory usage here before too long. * Query the db to find user matches rather than search the array. Performance is much much better. * Speed/memory improvements in importers. Move to querying the db rather than maintaining an array for all importers. Also only store the id of items when we import, rather than the full model. It saves a decent amount of memory. * Remove grouping of items in select2 With the values being set dynamically, the grouping is redundant. It also caused a regression with automatically guessing/matching field names. This is starting to get close. * Remove debug line on every create. * Switch migration to be text field instead of json field for compatibility with older mysql/mariadb * Fix asset import regression matching email address. * Rearrange travis order in attempt to fix null settings. * Use auth::id instead of fetching it off the user. Fixes a null object reference during seeding.
2017-06-21 16:37:37 -07:00
'as' => 'imports.index',
2021-06-10 13:17:14 -07:00
'uses' => [ImportsController::class, 'index'],
Importer mapping - v1 (#3677) * Move importer to an inline-template, allows for translations and easier passing of data from laravel to vue. * Pull the modal out into a dedicated partial, move importer to views/importer. * Add document of CSV->importer mappings. Reorganize some code. Progress. * Add header_row and first_row to imports table, and process upon uploading a file * Use an expandable table row instead of a modal for import processing. This should allow for field mapping interaction easier. * Fix import processing after moving method. * Frontend importer mapping improvements. Invert display so we show found columns and allow users to select an importer field to map to. Also implement sample data based on first row of csv. * Update select2. Maintain selected items properly. * Backend support for importing. Only works on the web importer currently. Definitely needs testing and polish. * We no longer use vue-modal plugin. * Add a column to track field mappings to the imports table. * Cleanup/rename methods+refactor * Save field mappings and import type when attempting an import, and repopulate these values when returning to the page. * Update debugbar to fix a bug in the debugbar code. * Fix asset tag detection. Also rename findMatch to be a bit clearer as to what it does. Remove logging to file of imports for http imports because it eats an incredible amouint of memory. This commit also moves imports out of the hardware namespace and into their own webcontroller and route prefix, remove dead code from AssetController as a result. * Dynamically limit options for select2 based on import type selected, and group them by item type. * Add user importer. Still need to implement emailing of passwords to new users, and probably test a bit more. This also bumps the memory limit for web imports up as well, I need to profile memory usage here before too long. * Query the db to find user matches rather than search the array. Performance is much much better. * Speed/memory improvements in importers. Move to querying the db rather than maintaining an array for all importers. Also only store the id of items when we import, rather than the full model. It saves a decent amount of memory. * Remove grouping of items in select2 With the values being set dynamically, the grouping is redundant. It also caused a regression with automatically guessing/matching field names. This is starting to get close. * Remove debug line on every create. * Switch migration to be text field instead of json field for compatibility with older mysql/mariadb * Fix asset import regression matching email address. * Rearrange travis order in attempt to fix null settings. * Use auth::id instead of fetching it off the user. Fixes a null object reference during seeding.
2017-06-21 16:37:37 -07:00
]);
});
2016-03-25 01:18:05 -07:00
/*
|--------------------------------------------------------------------------
| Account Routes
|--------------------------------------------------------------------------
|
|
|
*/
Route::group(['prefix' => 'account', 'middleware' => ['auth']], function () {
2016-03-25 01:18:05 -07:00
// Profile
2021-06-10 13:17:14 -07:00
Route::get('profile', ['as' => 'profile', 'uses' => [ProfileController::class, 'getIndex']]);
Route::post('profile', [ProfileController::class, 'postIndex']);
2021-06-10 13:17:14 -07:00
Route::get('menu', ['as' => 'account.menuprefs', 'uses' => [ProfileController::class, 'getMenuState']]);
2017-10-25 20:15:30 -07:00
2021-06-10 13:17:14 -07:00
Route::get('password', ['as' => 'account.password.index', 'uses' => [ProfileController::class, 'password']]);
Route::post('password', ['uses' => [ProfileController::class, 'passwordSave']]);
2021-06-10 13:17:14 -07:00
Route::get('api', ['as' => 'user.api', 'uses' => [ProfileController::class, 'api']]);
2017-01-11 03:38:55 -08:00
// View Assets
2021-06-10 13:17:14 -07:00
Route::get('view-assets', ['as' => 'view-assets', 'uses' => [ViewAssetsController::class, 'getIndex']]);
2016-03-25 01:18:05 -07:00
2021-06-10 13:17:14 -07:00
Route::get('requested', ['as' => 'account.requested', 'uses' => [ViewAssetsController::class, 'getRequestedAssets']]);
WIP - Improved requested assets (#5289) * WIP - beginning of improved requested assets - Use Ajax tables for faster loading - Use new notifications for requesting an asset TODO: - Use ajax tables for requestable asset models - Use new notifications for canceling an asset request - Expire requests once the asset has been checked out to the requesting user * Only show asset name in email if it has one * Refactor requested method to only include non-canceled requests * Refactored requestable assets to log request and cancelation * Added softdeletes on checkout requests * Differentiate between canceling and deleting requests * Added asset request cancelation notification * Added timestamps and corrected unique key on requests table * Improved requests view * Re-use blade for cancel/request email * Refactored BS table formatter for requested assets * Location name min reduced to 2 * Added PAT test as maintenance option This needs to be refactored into database-driven options with a UI * Better slack message * Added getImageUrl method for assets * Include qty in request notifications TODO: - Try to pull requested info from original request for cancelation, otherwise it will default to 1 * Removed old asset request/cancel emails * Added user profile asset request routes * Added profile controller requested assets method * Added blade link to requested assets for profile view * Sort user history desc * Added requested assets blade * Added canceled at to checkoutRequest method * Include qty in request * Fixed comment, removed allowed_columns * Removed Queable methods, since we don’t use a queue * Fixed return type in method doc * Fixed version number * Changed id to user_id for clarity
2018-04-04 17:33:02 -07:00
// Accept Asset
2016-03-25 01:18:05 -07:00
Route::get(
'accept-asset/{logID}',
2021-06-10 13:17:14 -07:00
['as' => 'account/accept-assets', 'uses' => [ViewAssetsController::class, 'getAcceptAsset']]
2016-03-25 01:18:05 -07:00
);
// Profile
2016-03-25 01:18:05 -07:00
Route::get(
'requestable-assets',
2021-06-10 13:17:14 -07:00
['as' => 'requestable-assets', 'uses' => [ViewAssetsController::class, 'getRequestableIndex']]
2016-03-25 01:18:05 -07:00
);
Route::get(
'request-asset/{assetId}',
2021-06-10 13:17:14 -07:00
['as' => 'account/request-asset', 'uses' => [ViewAssetsController::class, 'getRequestAsset']]
2016-03-25 01:18:05 -07:00
);
Route::post(
'request/{itemType}/{itemId}',
2021-06-10 13:17:14 -07:00
['as' => 'account/request-item', 'uses' => [ViewAssetsController::class, 'getRequestItem']]
);
// Account Dashboard
2021-06-10 13:17:14 -07:00
Route::get('/', ['as' => 'account', 'uses' => [ViewAssetsController::class, 'getIndex']]);
2021-06-10 13:17:14 -07:00
Route::get('accept', [Account\AcceptanceController::class, 'index'])
->name('account.accept');
2021-06-10 13:17:14 -07:00
Route::get('accept/{id}', [Account\AcceptanceController::class, 'create'])
->name('account.accept.item');
2021-06-10 13:17:14 -07:00
Route::post('accept/{id}', [Account\AcceptanceController::class, 'store']);
2016-03-25 01:18:05 -07:00
});
Route::group(['middleware' => ['auth']], function () {
Route::get('reports/audit', [
'as' => 'reports.audit',
2021-06-10 13:17:14 -07:00
'uses' => [ReportsController::class, 'audit'],
]);
2016-03-25 01:18:05 -07:00
Route::get(
'reports/depreciation',
2021-06-10 13:17:14 -07:00
['as' => 'reports/depreciation', 'uses' => [ReportsController::class, 'getDeprecationReport']]
2016-03-25 01:18:05 -07:00
);
Route::get(
'reports/export/depreciation',
2021-06-10 13:17:14 -07:00
['as' => 'reports/export/depreciation', 'uses' => [ReportsController::class, 'exportDeprecationReport']]
2016-03-25 01:18:05 -07:00
);
Route::get(
'reports/asset_maintenances',
2021-06-10 13:17:14 -07:00
['as' => 'reports/asset_maintenances', 'uses' => [ReportsController::class, 'getAssetMaintenancesReport']]
2016-03-25 01:18:05 -07:00
);
Route::get(
'reports/export/asset_maintenances',
[
'as' => 'reports/export/asset_maintenances',
2021-06-10 13:17:14 -07:00
'uses' => [ReportsController::class, 'exportAssetMaintenancesReport'],
2016-03-25 01:18:05 -07:00
]
);
Route::get(
'reports/licenses',
2021-06-10 13:17:14 -07:00
['as' => 'reports/licenses', 'uses' => [ReportsController::class, 'getLicenseReport']]
2016-03-25 01:18:05 -07:00
);
Route::get(
'reports/export/licenses',
2021-06-10 13:17:14 -07:00
['as' => 'reports/export/licenses', 'uses' => [ReportsController::class, 'exportLicenseReport']]
2016-03-25 01:18:05 -07:00
);
2018-05-02 14:13:06 -07:00
2021-06-10 13:17:14 -07:00
Route::get('reports/accessories', ['as' => 'reports/accessories', 'uses' => [ReportsController::class, 'getAccessoryReport']]);
2016-03-25 01:18:05 -07:00
Route::get(
'reports/export/accessories',
2021-06-10 13:17:14 -07:00
['as' => 'reports/export/accessories', 'uses' => [ReportsController::class, 'exportAccessoryReport']]
2016-03-25 01:18:05 -07:00
);
2021-06-10 13:17:14 -07:00
Route::get('reports/custom', ['as' => 'reports/custom', 'uses' => [ReportsController::class, 'getCustomReport']]);
Route::post('reports/custom', [ReportsController::class, 'postCustom']);
2016-03-25 01:18:05 -07:00
Route::get(
'reports/activity',
2021-06-10 13:17:14 -07:00
['as' => 'reports.activity', 'uses' => [ReportsController::class, 'getActivityReport']]
2016-03-25 01:18:05 -07:00
);
2016-09-19 23:52:01 -07:00
2021-06-10 13:17:14 -07:00
Route::post('reports/activity', [ReportsController::class, 'postActivityReport']);
2016-03-25 01:18:05 -07:00
Route::get(
'reports/unaccepted_assets',
2021-06-10 13:17:14 -07:00
['as' => 'reports/unaccepted_assets', 'uses' => [ReportsController::class, 'getAssetAcceptanceReport']]
2016-03-25 01:18:05 -07:00
);
Route::get(
'reports/export/unaccepted_assets',
2021-06-10 13:17:14 -07:00
['as' => 'reports/export/unaccepted_assets', 'uses' => [ReportsController::class, 'exportAssetAcceptanceReport']]
2016-03-25 01:18:05 -07:00
);
});
2017-02-02 18:14:25 -08:00
Route::get(
'auth/signin',
2021-06-10 13:17:14 -07:00
['uses' => [Auth\LoginController::class, 'legacyAuthRedirect']]
2017-02-02 18:14:25 -08:00
);
2016-03-25 01:18:05 -07:00
/*
|--------------------------------------------------------------------------
| Setup Routes
|--------------------------------------------------------------------------
|
|
|
*/
Route::group(['prefix' => 'setup', 'middleware' => 'web'], function () {
2016-03-25 01:18:05 -07:00
Route::get(
'user',
[
'as' => 'setup.user',
2021-06-10 13:17:14 -07:00
'uses' => [SettingsController::class, 'getSetupUser'], ]
2016-03-25 01:18:05 -07:00
);
Route::post(
'user',
[
'as' => 'setup.user.save',
2021-06-10 13:17:14 -07:00
'uses' => [SettingsController::class, 'postSaveFirstAdmin'], ]
2016-03-25 01:18:05 -07:00
);
Route::get(
'migrate',
[
'as' => 'setup.migrate',
2021-06-10 13:17:14 -07:00
'uses' => [SettingsController::class, 'getSetupMigrate'], ]
2016-03-25 01:18:05 -07:00
);
Route::get(
'done',
[
'as' => 'setup.done',
2021-06-10 13:17:14 -07:00
'uses' => [SettingsController::class, 'getSetupDone'], ]
2016-03-25 01:18:05 -07:00
);
Route::get(
'mailtest',
[
'as' => 'setup.mailtest',
2021-06-10 13:17:14 -07:00
'uses' => [SettingsController::class, 'ajaxTestEmail'], ]
2016-03-25 01:18:05 -07:00
);
Route::get(
'/',
[
'as' => 'setup',
2021-06-10 13:17:14 -07:00
'uses' => [SettingsController::class, 'getSetupIndex'], ]
2016-03-25 01:18:05 -07:00
);
});
Route::get(
'two-factor-enroll',
[
'as' => 'two-factor-enroll',
'middleware' => ['web'],
2021-06-10 13:17:14 -07:00
'uses' => [Auth\LoginController::class, 'getTwoFactorEnroll'], ]
);
Route::get(
'two-factor',
[
'as' => 'two-factor',
'middleware' => ['web'],
2021-06-10 13:17:14 -07:00
'uses' => [Auth\LoginController::class, 'getTwoFactorAuth'], ]
);
Route::post(
'two-factor',
[
'as' => 'two-factor',
'middleware' => ['web'],
2021-06-10 13:17:14 -07:00
'uses' => [Auth\LoginController::class, 'postTwoFactorAuth'], ]
);
2016-03-25 01:18:05 -07:00
Route::get(
'/',
[
'as' => 'home',
'middleware' => ['auth'],
2021-06-10 13:17:14 -07:00
'uses' => [DashboardController::class, 'getIndex'], ]
2016-03-25 01:18:05 -07:00
);
Route::group(['middleware' => 'web'], function () {
//Route::auth();
Route::get(
'login',
[
'as' => 'login',
'middleware' => ['web'],
2021-06-10 13:17:14 -07:00
'uses' => [Auth\LoginController::class, 'showLoginForm'], ]
);
Route::post(
'login',
[
'as' => 'login',
'middleware' => ['web'],
2021-06-10 13:17:14 -07:00
'uses' => [Auth\LoginController::class, 'login'], ]
);
Route::get(
'logout',
[
'as' => 'logout',
2021-06-10 13:17:14 -07:00
'uses' => [Auth\LoginController::class, 'logout'], ]
);
2016-03-25 01:18:05 -07:00
});
Auth::routes();
2017-05-09 00:37:37 -07:00
2021-06-10 13:17:14 -07:00
Route::get('/health', ['as' => 'health', 'uses' => [HealthController::class, 'get']]);