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;
|
2025-02-19 06:05:12 -08:00
|
|
|
use App\Http\Controllers\Auth\ForgotPasswordController;
|
|
|
|
use App\Http\Controllers\Auth\LoginController;
|
|
|
|
use App\Http\Controllers\Auth\ResetPasswordController;
|
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;
|
2022-11-02 02:23:52 -07:00
|
|
|
use App\Http\Controllers\LabelsController;
|
2021-06-10 13:17:14 -07:00
|
|
|
use App\Http\Controllers\LocationsController;
|
|
|
|
use App\Http\Controllers\ManufacturersController;
|
|
|
|
use App\Http\Controllers\ModalController;
|
2025-02-18 15:20:06 -08:00
|
|
|
use App\Http\Controllers\NotesController;
|
2021-06-10 13:17:14 -07:00
|
|
|
use App\Http\Controllers\ProfileController;
|
2023-12-18 12:55:48 -08:00
|
|
|
use App\Http\Controllers\ReportTemplatesController;
|
2025-02-19 06:05:12 -08:00
|
|
|
use App\Http\Controllers\ReportsController;
|
2021-06-10 13:17:14 -07:00
|
|
|
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;
|
2024-06-05 11:48:47 -07:00
|
|
|
use App\Livewire\Importer;
|
2025-02-19 06:05:12 -08:00
|
|
|
use App\Models\ReportTemplate;
|
2021-06-10 13:17:14 -07:00
|
|
|
use Illuminate\Support\Facades\Route;
|
2025-02-18 16:37:09 -08:00
|
|
|
use Tabuna\Breadcrumbs\Trail;
|
2021-06-10 13:17:14 -07:00
|
|
|
|
2017-03-11 05:16:56 -08:00
|
|
|
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, [
|
2021-06-10 13:15:52 -07:00
|
|
|
'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, [
|
2021-06-10 13:15:52 -07:00
|
|
|
'parameters' => ['category' => 'category_id'],
|
2017-05-22 21:31:47 -07:00
|
|
|
]);
|
2023-07-30 16:57:29 -07:00
|
|
|
|
2022-11-02 02:23:52 -07:00
|
|
|
/*
|
|
|
|
* Labels
|
|
|
|
*/
|
|
|
|
Route::get(
|
|
|
|
'labels/{labelName}',
|
|
|
|
[LabelsController::class, 'show']
|
|
|
|
)->where('labelName', '.*')->name('labels.show');
|
|
|
|
|
2017-05-22 21:31:47 -07:00
|
|
|
/*
|
2023-03-01 14:05:53 -08:00
|
|
|
* Locations
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => 'locations', 'middleware' => ['auth']], function () {
|
2024-02-20 08:42:14 -08:00
|
|
|
|
|
|
|
Route::post(
|
|
|
|
'bulkdelete',
|
|
|
|
[LocationsController::class, 'postBulkDelete']
|
|
|
|
)->name('locations.bulkdelete.show');
|
|
|
|
|
|
|
|
Route::post(
|
|
|
|
'bulkedit',
|
|
|
|
[LocationsController::class, 'postBulkDeleteStore']
|
|
|
|
)->name('locations.bulkdelete.store');
|
|
|
|
|
2024-08-19 05:19:59 -07:00
|
|
|
Route::post(
|
|
|
|
'{location}/restore',
|
|
|
|
[LocationsController::class, 'postRestore']
|
|
|
|
)->name('locations.restore');
|
|
|
|
|
2024-02-20 08:42:14 -08:00
|
|
|
|
2023-03-01 14:05:53 -08:00
|
|
|
Route::get('{locationId}/clone',
|
|
|
|
[LocationsController::class, 'getClone']
|
2023-04-26 09:52:13 -07:00
|
|
|
)->name('clone/location');
|
2023-03-01 14:05:53 -08:00
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'{locationId}/printassigned',
|
|
|
|
[LocationsController::class, 'print_assigned']
|
|
|
|
)->name('locations.print_assigned');
|
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'{locationId}/printallassigned',
|
|
|
|
[LocationsController::class, 'print_all_assigned']
|
|
|
|
)->name('locations.print_all_assigned');
|
2024-02-20 08:42:14 -08:00
|
|
|
|
2023-03-01 14:05:53 -08:00
|
|
|
});
|
|
|
|
|
2021-06-10 13:17:14 -07:00
|
|
|
Route::resource('locations', LocationsController::class, [
|
2021-06-10 13:15:52 -07:00
|
|
|
'parameters' => ['location' => 'location_id'],
|
2017-05-22 21:31:47 -07:00
|
|
|
]);
|
2021-06-10 13:15:52 -07:00
|
|
|
|
2017-05-22 21:31:47 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Manufacturers
|
|
|
|
*/
|
2018-03-03 18:46:19 -08:00
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
Route::group(['prefix' => 'manufacturers', 'middleware' => ['auth']], function () {
|
2022-01-12 20:51:33 -08:00
|
|
|
Route::post('{manufacturers_id}/restore', [ManufacturersController::class, 'restore'] )->name('restore/manufacturer');
|
2018-03-03 18:46:19 -08:00
|
|
|
});
|
|
|
|
|
2025-02-18 22:19:50 -08:00
|
|
|
Route::resource('manufacturers', ManufacturersController::class);
|
2017-05-22 21:31:47 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Suppliers
|
|
|
|
*/
|
2025-02-18 19:29:31 -08:00
|
|
|
Route::resource('suppliers', SuppliersController::class);
|
2017-05-22 21:31:47 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Depreciations
|
|
|
|
*/
|
2025-02-18 19:29:31 -08:00
|
|
|
Route::resource('depreciations', DepreciationsController::class);
|
2017-05-22 21:31:47 -07:00
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
/*
|
|
|
|
* Status Labels
|
|
|
|
*/
|
2025-02-18 19:29:31 -08:00
|
|
|
Route::resource('statuslabels', StatuslabelsController::class);
|
2017-05-22 21:31:47 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Departments
|
|
|
|
*/
|
2025-02-18 22:19:50 -08:00
|
|
|
Route::resource('departments', DepartmentsController::class);
|
2017-03-11 05:16:56 -08:00
|
|
|
});
|
|
|
|
|
2017-08-24 22:24:02 -07:00
|
|
|
/*
|
|
|
|
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Re-Usable Modal Dialog routes.
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Routes for various modal dialogs to interstitially create various things
|
2021-06-10 13:15:52 -07:00
|
|
|
|
|
2017-08-24 22:24:02 -07:00
|
|
|
*/
|
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
Route::group(['middleware' => 'auth', 'prefix' => 'modals'], function () {
|
2021-06-11 17:12:06 -07:00
|
|
|
Route::get('{type}/{itemId?}', [ModalController::class, 'show'] )->name('modal.show');
|
2017-08-24 22:24:02 -07:00
|
|
|
});
|
2017-01-13 00:13:57 -08:00
|
|
|
|
2016-10-31 21:00:30 -07:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Log Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Register all the admin routes.
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
Route::group(['middleware' => 'auth'], function () {
|
|
|
|
Route::get(
|
|
|
|
'display-sig/{filename}',
|
2021-06-11 17:12:06 -07:00
|
|
|
[ActionlogController::class, 'displaySig']
|
|
|
|
)->name('log.signature.view');
|
2022-03-08 16:42:27 -08:00
|
|
|
Route::get(
|
2022-05-17 06:57:10 -07:00
|
|
|
'stored-eula-file/{filename}',
|
2022-03-16 11:51:40 -07:00
|
|
|
[ActionlogController::class, 'getStoredEula']
|
2022-03-08 16:42:27 -08:00
|
|
|
)->name('log.storedeula.download');
|
2016-10-31 21:00:30 -07:00
|
|
|
});
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Admin Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Register all the admin routes.
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
Route::group(['prefix' => 'admin', 'middleware' => ['auth', 'authorize:superuser']], function () {
|
2016-08-02 00:54:38 -07:00
|
|
|
|
2025-02-19 06:05:12 -08:00
|
|
|
Route::get('settings', [SettingsController::class, 'getSettings'])
|
|
|
|
->name('settings.general.index')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('settings.index')
|
|
|
|
->push(trans('admin/settings/general.general_title'), route('settings.general.index')));
|
|
|
|
|
|
|
|
Route::post('settings', [SettingsController::class, 'postSettings'])
|
|
|
|
->name('settings.general.save');
|
|
|
|
|
|
|
|
Route::get('branding', [SettingsController::class, 'getBranding'])
|
|
|
|
->name('settings.branding.index')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('settings.index')
|
|
|
|
->push(trans('admin/settings/general.branding_title'), route('settings.branding.index')));
|
|
|
|
|
|
|
|
Route::post('branding', [SettingsController::class, 'postBranding'])
|
|
|
|
->name('settings.branding.save');
|
|
|
|
|
|
|
|
Route::get('security', [SettingsController::class, 'getSecurity'])
|
|
|
|
->name('settings.security.index')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('settings.index')
|
|
|
|
->push(trans('admin/settings/general.security_title'), route('settings.security.index')));
|
|
|
|
|
|
|
|
Route::post('security', [SettingsController::class, 'postSecurity'])
|
|
|
|
->name('settings.security.save');
|
|
|
|
|
|
|
|
Route::get('localization', [SettingsController::class, 'getLocalization'])
|
|
|
|
->name('settings.localization.index')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('settings.index')
|
|
|
|
->push(trans('admin/settings/general.localization_title'), route('settings.localization.index')));
|
|
|
|
|
|
|
|
Route::post('localization', [SettingsController::class, 'postLocalization'])
|
|
|
|
->name('settings.localization.save');
|
|
|
|
|
|
|
|
Route::get('notifications', [SettingsController::class, 'getAlerts'])
|
|
|
|
->name('settings.alerts.index')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('settings.index')
|
|
|
|
->push(trans('admin/settings/general.alert_title'), route('settings.alerts.index')));
|
|
|
|
|
|
|
|
Route::post('notifications', [SettingsController::class, 'postAlerts'])
|
|
|
|
->name('settings.alerts.save');
|
|
|
|
|
|
|
|
Route::get('slack', [SettingsController::class, 'getSlack'])
|
|
|
|
->name('settings.slack.index')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('settings.index')
|
|
|
|
->push(trans('admin/settings/general.webhook_title'), route('settings.slack.index')));
|
|
|
|
|
|
|
|
Route::post('slack', [SettingsController::class, 'postSlack'])
|
|
|
|
->name('settings.slack.save');
|
|
|
|
|
|
|
|
Route::get('asset_tags', [SettingsController::class, 'getAssetTags'])
|
|
|
|
->name('settings.asset_tags.index')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('settings.index')
|
|
|
|
->push(trans('admin/settings/general.asset_tag_title'), route('settings.asset_tags.index')));
|
|
|
|
|
|
|
|
Route::post('asset_tags', [SettingsController::class, 'postAssetTags'])
|
|
|
|
->name('settings.asset_tags.save');
|
|
|
|
|
|
|
|
Route::get('labels', [SettingsController::class, 'getLabels'])
|
|
|
|
->name('settings.labels.index')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('settings.index')
|
|
|
|
->push(trans('admin/settings/general.labels_title'), route('settings.labels.index')));
|
|
|
|
|
|
|
|
Route::post('labels', [SettingsController::class, 'postLabels'])
|
|
|
|
->name('settings.labels.save');
|
|
|
|
|
|
|
|
Route::get('ldap', [SettingsController::class, 'getLdapSettings'])
|
|
|
|
->name('settings.ldap.index')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('settings.index')
|
|
|
|
->push(trans('admin/settings/general.ldap_ad'), route('settings.ldap.index')));
|
|
|
|
|
|
|
|
Route::post('ldap', [SettingsController::class, 'postLdapSettings'])
|
|
|
|
->name('settings.ldap.save');
|
|
|
|
|
|
|
|
Route::get('phpinfo', [SettingsController::class, 'getPhpInfo'])
|
|
|
|
->name('settings.phpinfo.index')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('settings.index')
|
|
|
|
->push(trans('admin/settings/general.php_info'), route('settings.phpinfo.index')));
|
|
|
|
|
|
|
|
Route::get('oauth', [SettingsController::class, 'api'])
|
|
|
|
->name('settings.oauth.index')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('settings.index')
|
|
|
|
->push(trans('admin/settings/general.oauth'), route('settings.oauth.index')));
|
|
|
|
|
|
|
|
Route::get('google', [SettingsController::class, 'getGoogleLoginSettings'])
|
|
|
|
->name('settings.google.index')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('settings.index')
|
|
|
|
->push(trans('admin/settings/general.google_login'), route('settings.google.index')));
|
|
|
|
|
|
|
|
Route::post('google', [SettingsController::class, 'postGoogleLoginSettings'])
|
|
|
|
->name('settings.google.save');
|
|
|
|
|
|
|
|
Route::get('purge', [SettingsController::class, 'getPurge'])
|
|
|
|
->name('settings.purge.index')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('settings.index')
|
|
|
|
->push(trans('admin/settings/general.purge'), route('settings.purge.index')));
|
|
|
|
|
|
|
|
Route::post('purge', [SettingsController::class, 'postPurge'])
|
|
|
|
->name('settings.purge.save');
|
|
|
|
|
|
|
|
Route::get('login-attempts', [SettingsController::class, 'getLoginAttempts'])
|
|
|
|
->name('settings.logins.index')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('settings.index')
|
|
|
|
->push(trans('admin/settings/general.login'), route('settings.logins.index')));
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-07-13 05:50:40 -07:00
|
|
|
|
2025-02-20 06:58:17 -08:00
|
|
|
// SAML
|
|
|
|
Route::get('/saml', [SettingsController::class, 'getSamlSettings'])
|
|
|
|
->name('settings.saml.index')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('settings.index')
|
|
|
|
->push(trans('admin/settings/general.saml_title'), route('settings.saml.index')));
|
2016-07-13 05:50:40 -07:00
|
|
|
|
2025-02-20 06:58:17 -08:00
|
|
|
Route::post('/saml', [SettingsController::class, 'postSamlSettings'])
|
|
|
|
->name('settings.saml.save');
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-07-13 05:50:40 -07:00
|
|
|
|
|
|
|
|
2017-07-07 23:44:48 -07:00
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
// Backups
|
|
|
|
Route::group(['prefix' => 'backups', 'middleware' => 'auth'], function () {
|
2021-06-11 17:12:06 -07:00
|
|
|
Route::get('download/{filename}',
|
|
|
|
[SettingsController::class, 'downloadFile'])->name('settings.backups.download');
|
2017-07-07 23:44:48 -07:00
|
|
|
|
2021-06-11 17:12:06 -07:00
|
|
|
Route::delete('delete/{filename}',
|
|
|
|
[SettingsController::class, 'deleteFile'])->name('settings.backups.destroy');
|
2017-07-07 23:44:48 -07:00
|
|
|
|
2021-06-11 17:12:06 -07:00
|
|
|
Route::post('/',
|
|
|
|
[SettingsController::class, 'postBackups']
|
|
|
|
)->name('settings.backups.create');
|
2017-07-07 23:44:48 -07:00
|
|
|
|
2021-11-09 19:39:50 -08:00
|
|
|
Route::post('/restore/{filename}',
|
|
|
|
[SettingsController::class, 'postRestore']
|
|
|
|
)->name('settings.backups.restore');
|
|
|
|
|
|
|
|
Route::post('/upload',
|
|
|
|
[SettingsController::class, 'postUploadBackup']
|
|
|
|
)->name('settings.backups.upload');
|
|
|
|
|
2023-10-30 13:01:01 -07:00
|
|
|
// Handle redirect from after POST request from backup restore
|
|
|
|
Route::get('/restore/{filename?}', function () {
|
|
|
|
return redirect(route('settings.backups.index'));
|
|
|
|
});
|
|
|
|
|
2025-02-19 06:05:12 -08:00
|
|
|
Route::get('/', [SettingsController::class, 'getBackups'])
|
|
|
|
->name('settings.backups.index')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('settings.index')
|
|
|
|
->push(trans('admin/settings/general.backups'), route('settings.backups.index')));
|
2016-03-25 01:18:05 -07:00
|
|
|
});
|
|
|
|
|
2025-02-18 19:29:31 -08:00
|
|
|
Route::resource('groups', GroupsController::class);
|
2017-07-07 23:44:48 -07:00
|
|
|
|
|
|
|
|
2025-02-20 06:58:17 -08:00
|
|
|
/**
|
|
|
|
* This breadcrumb is repeated for groups in the BreadcrumbServiceProvider, since groups uses resource routes
|
|
|
|
* and that servcie provider cannot see the breadcrumbs defined below
|
|
|
|
*/
|
2025-02-19 06:05:12 -08:00
|
|
|
Route::get('/', [SettingsController::class, 'index'])
|
|
|
|
->name('settings.index')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('home')
|
2025-02-20 06:58:17 -08:00
|
|
|
->push(trans('general.admin'), route('settings.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
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
2023-02-28 18:36:52 -08:00
|
|
|
|
2025-02-19 06:05:12 -08:00
|
|
|
Route::get('/import', Importer::class)
|
|
|
|
->middleware('auth')
|
|
|
|
->name('imports.index')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('home')
|
|
|
|
->push(trans('general.import'), route('imports.index')));
|
2017-02-01 18:50:28 -08:00
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Account Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
2021-06-10 13:15:52 -07:00
|
|
|
Route::group(['prefix' => 'account', 'middleware' => ['auth']], function () {
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
// Profile
|
2025-02-19 06:05:12 -08:00
|
|
|
Route::get('profile', [ProfileController::class, 'getIndex'])
|
|
|
|
->name('profile')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('home')
|
|
|
|
->push(trans('general.editprofile'), route('profile')));
|
2017-08-22 12:09:04 -07:00
|
|
|
|
2025-02-19 06:05:12 -08:00
|
|
|
Route::post('profile', [ProfileController::class, 'postIndex'])
|
|
|
|
->name('profile.update');
|
2017-10-25 20:15:30 -07:00
|
|
|
|
2025-02-19 06:05:12 -08:00
|
|
|
Route::get('menu', [ProfileController::class, 'getMenuState'])
|
|
|
|
->name('account.menuprefs');
|
2017-08-22 12:09:04 -07:00
|
|
|
|
2025-02-19 06:05:12 -08:00
|
|
|
Route::get('password', [ProfileController::class, 'password'])
|
|
|
|
->name('account.password.index')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('home')
|
|
|
|
->push(trans('general.changepassword'), route('account.password.index')));
|
2017-01-11 03:38:55 -08:00
|
|
|
|
2025-02-19 06:05:12 -08:00
|
|
|
Route::post('password', [ProfileController::class, 'passwordSave'])
|
|
|
|
->name('account.password.update');
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2025-02-19 06:05:12 -08:00
|
|
|
Route::get('api', [ProfileController::class, 'api'])
|
|
|
|
->name('user.api')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('home')
|
|
|
|
->push(trans('general.manage_api_keys'), route('user.api')));
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2025-02-19 06:05:12 -08:00
|
|
|
// View Assets
|
|
|
|
Route::get('view-assets', [ViewAssetsController::class, 'getIndex'])
|
|
|
|
->name('view-assets')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('home')
|
|
|
|
->push(trans('general.viewassets'), route('view-assets')));
|
|
|
|
|
|
|
|
Route::get('requested', [ViewAssetsController::class, 'getRequestedAssets'])
|
|
|
|
->name('account.requested')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('home')
|
|
|
|
->push(trans('general.requested_assets_menu'), route('account.requested')));
|
2018-04-04 17:33:02 -07:00
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
// Profile
|
2016-03-25 01:18:05 -07:00
|
|
|
Route::get(
|
2025-02-19 06:05:12 -08:00
|
|
|
'requestable-assets', [ViewAssetsController::class, 'getRequestableIndex'])
|
|
|
|
->name('requestable-assets')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('home')
|
|
|
|
->push(trans('general.requestable_items'), route('requestable-assets')));
|
|
|
|
|
2021-12-16 20:32:29 -08:00
|
|
|
Route::post(
|
2016-03-25 01:18:05 -07:00
|
|
|
'request-asset/{assetId}',
|
2021-06-11 17:12:06 -07:00
|
|
|
[ViewAssetsController::class, 'getRequestAsset']
|
|
|
|
)->name('account/request-asset');
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-09-15 19:58:27 -07:00
|
|
|
Route::post(
|
2023-06-27 17:11:10 -07:00
|
|
|
'request/{itemType}/{itemId}/{cancel_by_admin?}/{requestingUser?}',
|
2021-06-11 17:12:06 -07:00
|
|
|
[ViewAssetsController::class, 'getRequestItem']
|
|
|
|
)->name('account/request-item');
|
2016-09-15 19:58:27 -07:00
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
// Account Dashboard
|
2025-02-19 06:05:12 -08:00
|
|
|
Route::get('/', [ViewAssetsController::class, 'getIndex'])
|
|
|
|
->name('account');
|
2018-07-27 16:15:32 -07:00
|
|
|
|
2021-06-10 13:17:14 -07:00
|
|
|
Route::get('accept', [Account\AcceptanceController::class, 'index'])
|
2025-02-19 06:05:12 -08:00
|
|
|
->name('account.accept')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('home')
|
|
|
|
->push(trans('general.accept_assets_menu'), route('account.accept')));
|
2021-06-10 13:15:52 -07:00
|
|
|
|
2022-01-13 16:03:32 -08:00
|
|
|
Route::get('accept/{id}', [Account\AcceptanceController::class, 'create'])
|
2025-02-19 06:05:12 -08:00
|
|
|
->name('account.accept.item')
|
|
|
|
->breadcrumbs(fn (Trail $trail, $id) =>
|
|
|
|
$trail->parent('account.accept')
|
|
|
|
->push(trans('general.accept_item'), route('account.accept.item', $id)));
|
2018-07-27 16:15:32 -07:00
|
|
|
|
2023-05-03 14:22:05 -07:00
|
|
|
Route::post('accept/{id}', [Account\AcceptanceController::class, 'store'])
|
|
|
|
->name('account.store-acceptance');
|
2022-10-04 15:45:25 -07:00
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'print',
|
|
|
|
[
|
|
|
|
ProfileController::class,
|
|
|
|
'printInventory'
|
|
|
|
]
|
|
|
|
)->name('profile.print');
|
|
|
|
|
|
|
|
Route::post(
|
|
|
|
'email',
|
|
|
|
[
|
|
|
|
ProfileController::class,
|
|
|
|
'emailAssetList'
|
|
|
|
]
|
|
|
|
)->name('profile.email_assets');
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
});
|
|
|
|
|
2025-02-18 15:20:06 -08:00
|
|
|
Route::group(['middleware' => ['auth']], function () {
|
|
|
|
Route::post('notes', [NotesController::class, 'store'])->name('notes.store');
|
|
|
|
});
|
|
|
|
|
2025-02-19 06:05:12 -08:00
|
|
|
Route::group(['prefix' => 'reports', 'middleware' => ['auth']], function () {
|
|
|
|
|
|
|
|
Route::get('audit', [ReportsController::class, 'audit'])
|
|
|
|
->name('reports.audit')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('home')
|
|
|
|
->push(trans('general.audit_report'), route('reports.audit')));
|
2017-08-25 10:04:19 -07:00
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
Route::get(
|
2025-02-19 06:05:12 -08:00
|
|
|
'depreciation', [ReportsController::class, 'getDeprecationReport'])
|
|
|
|
->name('reports/depreciation')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('home')
|
|
|
|
->push(trans('general.depreciation_report'), route('reports/depreciation')));
|
|
|
|
|
|
|
|
|
|
|
|
// Is this still used??
|
2016-03-25 01:18:05 -07:00
|
|
|
Route::get(
|
2025-02-19 06:05:12 -08:00
|
|
|
'export/depreciation', [ReportsController::class, 'exportDeprecationReport'])
|
|
|
|
->name('reports/export/depreciation')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('home')
|
|
|
|
->push(trans('general.depreciation_report'), route('reports.audit')));
|
2018-05-02 14:13:06 -07:00
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
Route::get(
|
2025-02-19 06:05:12 -08:00
|
|
|
'asset_maintenances', [ReportsController::class, 'getAssetMaintenancesReport'])
|
|
|
|
->name('reports/asset_maintenances')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('home')
|
|
|
|
->push(trans('general.asset_maintenance_report'), route('reports/asset_maintenances')));
|
|
|
|
|
|
|
|
// Is this still used?
|
|
|
|
Route::get('export/asset_maintenances', [ReportsController::class, 'exportAssetMaintenancesReport'])
|
|
|
|
->name('reports/export/asset_maintenances')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('home')
|
|
|
|
->push(trans('general.asset_maintenance_report'), route('reports/export/asset_maintenances')));
|
|
|
|
|
|
|
|
Route::get('licenses', [ReportsController::class, 'getLicenseReport'])
|
|
|
|
->name('reports/licenses')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('home')
|
|
|
|
->push(trans('general.license_report'), route('reports/licenses')));
|
|
|
|
|
|
|
|
Route::get('export/licenses', [ReportsController::class, 'exportLicenseReport'])
|
|
|
|
->name('reports/export/licenses');
|
|
|
|
|
|
|
|
Route::get('accessories', [ReportsController::class, 'getAccessoryReport'])
|
|
|
|
->name('reports/accessories');
|
|
|
|
|
|
|
|
Route::get('export/accessories', [ReportsController::class, 'exportAccessoryReport'])
|
|
|
|
->name('reports/export/accessories');
|
|
|
|
|
|
|
|
Route::get('custom', [ReportsController::class, 'getCustomReport'])
|
|
|
|
->name('reports/custom')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('home')
|
|
|
|
->push(trans('general.custom_report'), route('reports/custom')));
|
|
|
|
|
|
|
|
Route::post('custom', [ReportsController::class, 'postCustom']);
|
|
|
|
|
|
|
|
|
|
|
|
Route::prefix('templates')
|
|
|
|
->group(function () {
|
|
|
|
|
|
|
|
Route::post('/', [ReportTemplatesController::class, 'store'])
|
|
|
|
->name('report-templates.store');
|
|
|
|
|
|
|
|
// The breadcrumb on this is a little odd for now since we don't have a template index
|
|
|
|
Route::get('/{reportTemplate}', [ReportTemplatesController::class, 'show'])
|
|
|
|
->name('report-templates.show')
|
|
|
|
->breadcrumbs(fn (Trail $trail, ReportTemplate $reportTemplate) =>
|
|
|
|
$trail->parent('reports/custom')
|
|
|
|
->push($reportTemplate->name, null)
|
|
|
|
->push(trans('general.customize_report'), ''));
|
|
|
|
|
|
|
|
Route::get('/{reportTemplate}/edit', [ReportTemplatesController::class, 'edit'])
|
|
|
|
->name('report-templates.edit')
|
|
|
|
->breadcrumbs(fn (Trail $trail, ReportTemplate $reportTemplate) =>
|
|
|
|
$trail->parent('reports/custom')
|
|
|
|
->push($reportTemplate->name, route('report-templates.show', $reportTemplate))
|
|
|
|
->push(trans('general.customize_report'), ''));
|
|
|
|
|
|
|
|
|
|
|
|
Route::post('/{reportTemplate}', [ReportTemplatesController::class, 'update'])
|
|
|
|
->name('report-templates.update');
|
|
|
|
|
|
|
|
Route::delete('/{reportTemplate}', [ReportTemplatesController::class, 'destroy'])
|
|
|
|
->name('report-templates.destroy');
|
2024-10-22 17:30:34 -07:00
|
|
|
});
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-09-19 23:52:01 -07:00
|
|
|
|
2020-11-13 16:25:05 -08:00
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
Route::get(
|
2025-02-19 06:05:12 -08:00
|
|
|
'activity', [ReportsController::class, 'getActivityReport'])
|
|
|
|
->name('reports.activity')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('home')
|
|
|
|
->push(trans('general.activity_report'), route('reports.activity')));
|
|
|
|
|
|
|
|
Route::post('activity', [ReportsController::class, 'postActivityReport'])
|
|
|
|
->name('reports.activity.post');
|
|
|
|
|
|
|
|
Route::get('unaccepted_assets/{deleted?}', [ReportsController::class, 'getAssetAcceptanceReport'])
|
|
|
|
->name('reports/unaccepted_assets')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->parent('home')
|
|
|
|
->push(trans('general.unaccepted_asset_report'), route('reports/unaccepted_assets')));
|
|
|
|
|
|
|
|
Route::post('unaccepted_assets/sent_reminder', [ReportsController::class, 'sentAssetAcceptanceReminder'])
|
|
|
|
->name('reports/unaccepted_assets_sent_reminder');
|
|
|
|
|
|
|
|
Route::delete('unaccepted_assets/{acceptanceId}/delete', [ReportsController::class, 'deleteAssetAcceptance'])
|
|
|
|
->name('reports/unaccepted_assets_delete');
|
|
|
|
|
2021-07-16 15:15:33 -07:00
|
|
|
Route::post(
|
2025-02-19 06:05:12 -08:00
|
|
|
'unaccepted_assets/{deleted?}', [ReportsController::class, 'postAssetAcceptanceReport'])
|
|
|
|
->name('reports/export/unaccepted_assets');
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
});
|
|
|
|
|
2025-02-19 06:05:12 -08:00
|
|
|
|
2017-02-02 18:14:25 -08:00
|
|
|
Route::get(
|
|
|
|
'auth/signin',
|
2021-06-11 17:12:06 -07:00
|
|
|
[LoginController::class, 'legacyAuthRedirect']
|
2017-02-02 18:14:25 -08:00
|
|
|
);
|
|
|
|
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Setup Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
2021-06-10 13:15:52 -07:00
|
|
|
Route::group(['prefix' => 'setup', 'middleware' => 'web'], function () {
|
2016-03-25 01:18:05 -07:00
|
|
|
Route::get(
|
|
|
|
'user',
|
2021-06-11 17:12:06 -07:00
|
|
|
[SettingsController::class, 'getSetupUser']
|
|
|
|
)->name('setup.user');
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
Route::post(
|
|
|
|
'user',
|
2021-06-11 17:12:06 -07:00
|
|
|
[SettingsController::class, 'postSaveFirstAdmin']
|
|
|
|
)->name('setup.user.save');
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'migrate',
|
2021-06-11 17:12:06 -07:00
|
|
|
[SettingsController::class, 'getSetupMigrate']
|
|
|
|
)->name('setup.migrate');
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'done',
|
2021-06-11 17:12:06 -07:00
|
|
|
[SettingsController::class, 'getSetupDone']
|
|
|
|
)->name('setup.done');
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'mailtest',
|
2021-06-11 17:12:06 -07:00
|
|
|
[SettingsController::class, 'ajaxTestEmail']
|
|
|
|
)->name('setup.mailtest');
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'/',
|
2021-06-11 17:12:06 -07:00
|
|
|
[SettingsController::class, 'getSetupIndex']
|
|
|
|
)->name('setup');
|
2016-03-25 01:18:05 -07:00
|
|
|
});
|
|
|
|
|
2022-05-13 12:45:54 -07:00
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2021-06-11 14:43:47 -07:00
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
Route::group(['middleware' => 'web'], function () {
|
2022-05-13 12:45:54 -07:00
|
|
|
|
2016-10-29 05:50:55 -07:00
|
|
|
Route::get(
|
|
|
|
'login',
|
2021-06-11 15:23:44 -07:00
|
|
|
[LoginController::class, 'showLoginForm']
|
|
|
|
)->name("login");
|
2016-12-15 04:12:18 -08:00
|
|
|
|
|
|
|
Route::post(
|
|
|
|
'login',
|
2021-06-11 15:23:44 -07:00
|
|
|
[LoginController::class, 'login']
|
2016-12-15 04:12:18 -08:00
|
|
|
);
|
|
|
|
|
2022-05-13 12:45:54 -07:00
|
|
|
Route::get(
|
|
|
|
'two-factor-enroll',
|
2022-05-13 12:48:55 -07:00
|
|
|
[LoginController::class, 'getTwoFactorEnroll']
|
|
|
|
)->name('two-factor-enroll');
|
2022-05-13 12:45:54 -07:00
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'two-factor',
|
2022-05-13 12:48:55 -07:00
|
|
|
[LoginController::class, 'getTwoFactorAuth']
|
|
|
|
)->name('two-factor');
|
2022-05-13 12:45:54 -07:00
|
|
|
|
|
|
|
Route::post(
|
|
|
|
'two-factor',
|
2022-05-13 12:48:55 -07:00
|
|
|
[LoginController::class, 'postTwoFactorAuth']
|
2022-06-22 09:11:24 -07:00
|
|
|
);
|
2022-06-21 18:40:53 -07:00
|
|
|
|
|
|
|
Route::post(
|
|
|
|
'password/email',
|
|
|
|
[ForgotPasswordController::class, 'sendResetLinkEmail']
|
2022-06-22 09:11:24 -07:00
|
|
|
)->name('password.email')->middleware('throttle:forgotten_password');
|
2022-06-21 18:40:53 -07:00
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'password/reset',
|
|
|
|
[ForgotPasswordController::class, 'showLinkRequestForm']
|
2022-06-22 09:11:24 -07:00
|
|
|
)->name('password.request')->middleware('throttle:forgotten_password');
|
2022-06-21 18:40:53 -07:00
|
|
|
|
|
|
|
|
|
|
|
Route::post(
|
|
|
|
'password/reset',
|
|
|
|
[ResetPasswordController::class, 'reset']
|
2022-06-22 09:11:24 -07:00
|
|
|
)->name('password.update')->middleware('throttle:forgotten_password');
|
2022-06-21 18:40:53 -07:00
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'password/reset/{token}',
|
|
|
|
[ResetPasswordController::class, 'showResetForm']
|
2022-06-21 18:53:14 -07:00
|
|
|
)->name('password.reset');
|
2022-06-21 18:40:53 -07:00
|
|
|
|
|
|
|
|
|
|
|
Route::post(
|
|
|
|
'password/email',
|
2022-06-21 19:11:57 -07:00
|
|
|
[ForgotPasswordController::class, 'sendResetLinkEmail']
|
2022-06-22 09:11:24 -07:00
|
|
|
)->name('password.email')->middleware('throttle:forgotten_password');
|
2022-06-21 18:40:53 -07:00
|
|
|
|
|
|
|
|
2023-05-10 00:14:28 -07:00
|
|
|
// Socialite Google login
|
|
|
|
Route::get('google', 'App\Http\Controllers\GoogleAuthController@redirectToGoogle')->name('google.redirect');
|
|
|
|
Route::get('google/callback', 'App\Http\Controllers\GoogleAuthController@handleGoogleCallback')->name('google.callback');
|
2022-06-21 18:40:53 -07:00
|
|
|
|
2022-05-13 12:45:54 -07:00
|
|
|
|
2022-05-14 04:59:34 -07:00
|
|
|
// need to keep GET /logout for SAML SLO
|
|
|
|
Route::get(
|
|
|
|
'logout',
|
|
|
|
[LoginController::class, 'logout']
|
2022-08-01 16:17:40 -07:00
|
|
|
)->name('logout.get');
|
2022-05-14 04:59:34 -07:00
|
|
|
|
2022-05-13 13:30:11 -07:00
|
|
|
Route::post(
|
2016-10-29 05:50:55 -07:00
|
|
|
'logout',
|
2021-06-11 17:12:06 -07:00
|
|
|
[LoginController::class, 'logout']
|
2022-08-01 16:17:40 -07:00
|
|
|
)->name('logout.post');
|
2016-03-25 01:18:05 -07:00
|
|
|
});
|
|
|
|
|
2017-05-09 00:37:37 -07:00
|
|
|
|
2024-10-02 07:36:01 -07:00
|
|
|
/**
|
|
|
|
* Health check route - skip middleware
|
|
|
|
*/
|
|
|
|
Route::withoutMiddleware(['web'])->get(
|
|
|
|
'/health',
|
2021-06-11 17:12:06 -07:00
|
|
|
[HealthController::class, 'get']
|
|
|
|
)->name('health');
|
2021-06-11 14:43:47 -07:00
|
|
|
|
2024-10-02 07:36:01 -07:00
|
|
|
|
2021-06-11 15:23:44 -07:00
|
|
|
Route::middleware(['auth'])->get(
|
2021-06-11 14:43:47 -07:00
|
|
|
'/',
|
2021-06-11 15:23:44 -07:00
|
|
|
[DashboardController::class, 'index']
|
2025-02-18 16:37:09 -08:00
|
|
|
)->name('home')
|
|
|
|
->breadcrumbs(fn (Trail $trail) =>
|
|
|
|
$trail->push('Home', route('home'))
|
|
|
|
);
|