A free open source IT asset/license management system
Fixed #12772 - use the APP_URL config more consistently
snipe161999fbca0d
diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.phpindex 1deaa5d104..f16a6fc8f0 100755--- a/app/Http/Controllers/SettingsController.php+++ b/app/Http/Controllers/SettingsController.php@@ -84,7 +84,7 @@ class SettingsController extends Controller}$pageURL = $protocol.$host.$_SERVER['REQUEST_URI'];- $start_settings['url_config'] = url('/').'/setup';+ $start_settings['url_config'] = config('app.url').'/setup';$start_settings['url_valid'] = ($start_settings['url_config'] === $pageURL);$start_settings['real_url'] = $pageURL;$start_settings['php_version_min'] = true;diff --git a/app/Http/Middleware/CheckForSetup.php b/app/Http/Middleware/CheckForSetup.phpindex b4beb70588..4e399ffcff 100644--- a/app/Http/Middleware/CheckForSetup.php+++ b/app/Http/Middleware/CheckForSetup.php@@ -20,13 +20,13 @@ class CheckForSetupif (Setting::setupCompleted()) {if ($request->is('setup*')) {- return redirect(url('/'));+ return redirect(config('app.url'));} else {return $next($request);}} else {if (! ($request->is('setup*')) && ! ($request->is('.env')) && ! ($request->is('health'))) {- return redirect(url('/').'/setup');+ return redirect(config('app.url').'/setup');}return $next($request);diff --git a/app/Models/Location.php b/app/Models/Location.phpindex 8181f406cd..8cea9bda12 100755--- a/app/Models/Location.php+++ b/app/Models/Location.php@@ -267,7 +267,7 @@ class Location extends SnipeModelforeach ($locations_with_children[$parent_id] as $location) {$location->use_text = $prefix.' '.$location->name;- $location->use_image = ($location->image) ? url('/').'/uploads/locations/'.$location->image : null;+ $location->use_image = ($location->image) ? config('app.url').'/uploads/locations/'.$location->image : null;$results[] = $location;//now append the children. (if we have any)if (array_key_exists($location->id, $locations_with_children)) {diff --git a/app/Notifications/FirstAdminNotification.php b/app/Notifications/FirstAdminNotification.phpindex 71637b5e80..83e3a65de7 100644--- a/app/Notifications/FirstAdminNotification.php+++ b/app/Notifications/FirstAdminNotification.php@@ -24,7 +24,7 @@ class FirstAdminNotification extends Notification$this->_data['last_name'] = $content['last_name'];$this->_data['username'] = $content['username'];$this->_data['password'] = $content['password'];- $this->_data['url'] = url('/');+ $this->_data['url'] = config('app.url');}/**diff --git a/app/Notifications/WelcomeNotification.php b/app/Notifications/WelcomeNotification.phpindex a5754be4d9..1e27ca7364 100644--- a/app/Notifications/WelcomeNotification.php+++ b/app/Notifications/WelcomeNotification.php@@ -24,7 +24,7 @@ class WelcomeNotification extends Notification$this->_data['last_name'] = htmlspecialchars_decode($content['last_name']);$this->_data['username'] = htmlspecialchars_decode($content['username']);$this->_data['password'] = htmlspecialchars_decode($content['password']);- $this->_data['url'] = url('/');+ $this->_data['url'] = config('app.url');}/**diff --git a/app/Presenters/AssetModelPresenter.php b/app/Presenters/AssetModelPresenter.phpindex fd74108ee3..8e3d109045 100644--- a/app/Presenters/AssetModelPresenter.php+++ b/app/Presenters/AssetModelPresenter.php@@ -210,7 +210,7 @@ class AssetModelPresenter extends Presenterpublic function imageUrl(){if (! empty($this->image)) {- return '<img src="'.url('/').'/uploads/models/'.$this->image.'" alt="'.$this->name.'" height="50" width="50">';+ return '<img src="'.config('app.url').'/uploads/models/'.$this->image.'" alt="'.$this->name.'" height="50" width="50">';}return '';@@ -223,7 +223,7 @@ class AssetModelPresenter extends Presenterpublic function imageSrc(){if (! empty($this->image)) {- return url('/').'/uploads/models/'.$this->image;+ return config('app.url').'/uploads/models/'.$this->image;}return '';diff --git a/app/Presenters/UserPresenter.php b/app/Presenters/UserPresenter.phpindex 4bfe4492ff..b5eefdf811 100644--- a/app/Presenters/UserPresenter.php+++ b/app/Presenters/UserPresenter.php@@ -406,7 +406,7 @@ class UserPresenter extends Presenter}// Set a fun, gender-neutral default icon- return url('/').'/img/default-sm.png';+ return config('app.url').'/img/default-sm.png';}/**diff --git a/app/Services/Saml.php b/app/Services/Saml.phpindex 3f39be29ff..f80b1c1fb9 100644--- a/app/Services/Saml.php+++ b/app/Services/Saml.php@@ -161,7 +161,7 @@ class Saml//Let onelogin/php-saml know to use 'X-Forwarded-*' headers if it is from a trusted proxyOneLogin_Saml2_Utils::setProxyVars(request()->isFromTrustedProxy());- data_set($settings, 'sp.entityId', url('/'));+ data_set($settings, 'sp.entityId', config('app.url'));data_set($settings, 'sp.assertionConsumerService.url', route('saml.acs'));data_set($settings, 'sp.singleLogoutService.url', route('saml.sls'));data_set($settings, 'sp.x509cert', $setting->saml_sp_x509cert);diff --git a/resources/views/account/requestable-assets.blade.php b/resources/views/account/requestable-assets.blade.phpindex 002fc4dc5c..ceadd2e374 100644--- a/resources/views/account/requestable-assets.blade.php+++ b/resources/views/account/requestable-assets.blade.php@@ -104,8 +104,8 @@<td>@if ($requestableModel->image)- <a href="{{ url('/') }}/uploads/models/{{ $requestableModel->image }}" data-toggle="lightbox" data-type="image">- <img src="{{ url('/') }}/uploads/models/{{ $requestableModel->image }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive">+ <a href="{{ config('app.url') }}/uploads/models/{{ $requestableModel->image }}" data-toggle="lightbox" data-type="image">+ <img src="{{ config('app.url') }}/uploads/models/{{ $requestableModel->image }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive"></a>@endifdiff --git a/resources/views/asset_maintenances/index.blade.php b/resources/views/asset_maintenances/index.blade.phpindex 69d3c2643b..f5deb48b61 100644--- a/resources/views/asset_maintenances/index.blade.php+++ b/resources/views/asset_maintenances/index.blade.php@@ -54,11 +54,11 @@function maintenanceActions(value, row) {var actions = '<nobr>';if ((row) && (row.available_actions.update === true)) {- actions += '<a href="{{ url('/') }}/hardware/maintenances/' + row.id + '/edit" class="btn btn-sm btn-warning" data-tooltip="true" title="Update"><i class="fas fa-pencil-alt"></i></a> ';+ actions += '<a href="{{ config('app.url') }}/hardware/maintenances/' + row.id + '/edit" class="btn btn-sm btn-warning" data-tooltip="true" title="Update"><i class="fas fa-pencil-alt"></i></a> ';}actions += '</nobr>'if ((row) && (row.available_actions.delete === true)) {- actions += '<a href="{{ url('/') }}/hardware/maintenances/' + row.id + '" '+ actions += '<a href="{{ config('app.url') }}/hardware/maintenances/' + row.id + '" '+ ' class="btn btn-danger btn-sm delete-asset" data-tooltip="true" '+ ' data-toggle="modal" '+ ' data-content="{{ trans('general.sure_to_delete') }} ' + row.name + '?" 'diff --git a/resources/views/errors/403.blade.php b/resources/views/errors/403.blade.phpindex 8a867e3776..d7405ba0f6 100644--- a/resources/views/errors/403.blade.php+++ b/resources/views/errors/403.blade.php@@ -16,11 +16,11 @@<div class="col-md-8 col-md-offset-2"><div style="padding-top: 200px">- <img src="{{ url('/') }}/img/sad-panda.png" style="width: 200px; height: 200px;" class="pull-left">+ <img src="{{ config('app.url') }}/img/sad-panda.png" style="width: 200px; height: 200px;" class="pull-left"><div class="error-content"><h2><i class="fas fa-exclamation-triangle text-yellow"></i> 403 Forbidden.</h2><p>- Sad panda. You are not authorized to do the thing. Maybe <a href="{{ url('/') }}">return to the dashboard</a>, or contact your administrator.+ Sad panda. You are not authorized to do the thing. Maybe <a href="{{ config('app.url') }}">return to the dashboard</a>, or contact your administrator.</p></div>diff --git a/resources/views/errors/404.blade.php b/resources/views/errors/404.blade.phpindex 03e140bd3a..77d7c32521 100644--- a/resources/views/errors/404.blade.php+++ b/resources/views/errors/404.blade.php@@ -16,12 +16,12 @@<div class="col-md-8 col-md-offset-2"><div style="padding-top: 200px">- <img src="{{ url('/') }}/img/sad-panda.png" style="width: 200px; height: 200px;" class="pull-left">+ <img src="{{ config('app.url') }}/img/sad-panda.png" style="width: 200px; height: 200px;" class="pull-left"><div class="error-content"><h2><i class="fas fa-exclamation-triangle text-yellow"></i> 404 Page not found.</h2><p>Sad panda. We could not find the page you were looking for.- You should maybe <a href="{{ url('/') }}">return to the dashboard</a>.+ You should maybe <a href="{{ config('app.url') }}">return to the dashboard</a>.</p></div>diff --git a/resources/views/errors/503.blade.php b/resources/views/errors/503.blade.phpindex 013d0f1ce6..4adb020d4e 100644--- a/resources/views/errors/503.blade.php+++ b/resources/views/errors/503.blade.php@@ -29,7 +29,7 @@<div class="col-md-12"><div class="col-md-2">- <img src="{{ url('/') }}/img/sad-panda.png" class="pull-right" style="width: 140px; height: 140px;">+ <img src="{{ config('app.url') }}/img/sad-panda.png" class="pull-right" style="width: 140px; height: 140px;"></div><div class="alert alert-warning fade in"><h2> {{ trans('general.maintenance_mode') }}</h2>diff --git a/resources/views/hardware/edit.blade.php b/resources/views/hardware/edit.blade.phpindex 56876ba47a..1e44b98dc4 100755--- a/resources/views/hardware/edit.blade.php+++ b/resources/views/hardware/edit.blade.php@@ -198,7 +198,7 @@$.ajax({type: 'GET',- url: "{{ url('/') }}/models/" + modelid + "/custom_fields",+ url: "{{ config('app.url') }}/models/" + modelid + "/custom_fields",headers: {"X-Requested-With": 'XMLHttpRequest',"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')@@ -230,7 +230,7 @@if (status_id != '') {$(".status_spinner").css("display", "inline");$.ajax({- url: "{{url('/') }}/api/v1/statuslabels/" + status_id + "/deployable",+ url: "{{config('app.url') }}/api/v1/statuslabels/" + status_id + "/deployable",headers: {"X-Requested-With": 'XMLHttpRequest',"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')diff --git a/resources/views/hardware/requested.blade.php b/resources/views/hardware/requested.blade.phpindex 5a38d89ce5..25b2a51e28 100644--- a/resources/views/hardware/requested.blade.php+++ b/resources/views/hardware/requested.blade.php@@ -64,7 +64,7 @@@if (($request->itemType() == "asset") && ($request->requestable))<a href="{{ $request->requestable->getImageUrl() }}" data-toggle="lightbox" data-type="image"><img src="{{ $request->requestable->getImageUrl() }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive" alt="{{ $request->requestable->name }}"></a>@elseif (($request->itemType() == "asset_model") && ($request->requestable))- <a href="{{ url('/') }}/uploads/models/{{ $request->requestable->image }}" data-toggle="lightbox" data-type="image"><img src="{{ url('/') }}/uploads/models/{{ $request->requestable->image }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive" alt="{{ $request->requestable->name }}"></a>+ <a href="{{ config('app.url') }}/uploads/models/{{ $request->requestable->image }}" data-toggle="lightbox" data-type="image"><img src="{{ config('app.url') }}/uploads/models/{{ $request->requestable->image }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive" alt="{{ $request->requestable->name }}"></a>@endif@@ -72,11 +72,11 @@<td>@if ($request->itemType() == "asset")- <a href="{{ url('/') }}/hardware/{{ $request->requestable->id }}">+ <a href="{{ config('app.url') }}/hardware/{{ $request->requestable->id }}">{{ $request->name() }}</a>@elseif ($request->itemType() == "asset_model")- <a href="{{ url('/') }}/models/{{ $request->requestable->id }}">+ <a href="{{ config('app.url') }}/models/{{ $request->requestable->id }}">{{ $request->name() }}</a>@endif@@ -95,7 +95,7 @@</td><td>@if ($request->requestingUser())- <a href="{{ url('/') }}/users/{{ $request->requestingUser()->id }}">+ <a href="{{ config('app.url') }}/users/{{ $request->requestingUser()->id }}">{{ $request->requestingUser()->present()->fullName() }}</a>@else@@ -106,9 +106,9 @@<td>@if ($request->itemType() == "asset")@if ($request->requestable->assigned_to=='')- <a href="{{ url('/') }}/hardware/{{ $request->requestable->id }}/checkout" class="btn btn-sm bg-maroon" data-tooltip="true" title="{{ trans('general.checkout_user_tooltip') }}">{{ trans('general.checkout') }}</a>+ <a href="{{ config('app.url') }}/hardware/{{ $request->requestable->id }}/checkout" class="btn btn-sm bg-maroon" data-tooltip="true" title="{{ trans('general.checkout_user_tooltip') }}">{{ trans('general.checkout') }}</a>@else- <a href="{{ url('/') }}/hardware/{{ $request->requestable->id }}/checkin" class="btn btn-sm bg-purple" data-tooltip="true" title="{{ trans('general.checkin_toolip') }}">{{ trans('general.checkin') }}</a>+ <a href="{{ config('app.url') }}/hardware/{{ $request->requestable->id }}/checkin" class="btn btn-sm bg-purple" data-tooltip="true" title="{{ trans('general.checkin_toolip') }}">{{ trans('general.checkin') }}</a>@endif@endifdiff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.phpindex 2bb9bc8cf9..84792ec0c8 100644--- a/resources/views/layouts/default.blade.php+++ b/resources/views/layouts/default.blade.php@@ -21,7 +21,7 @@<meta name="csrf-token" content="{{ csrf_token() }}">- <meta name="baseUrl" content="{{ url('/') }}/">+ <meta name="baseUrl" content="{{ config('app.url') }}/"><script nonce="{{ csrf_token() }}">window.Laravel = { csrfToken: '{{ csrf_token() }}' };@@ -105,21 +105,21 @@<div class="nav navbar-nav navbar-left"><div class="left-navblock">@if ($snipeSettings->brand == '3')- <a class="logo navbar-brand no-hover" href="{{ url('/') }}">+ <a class="logo navbar-brand no-hover" href="{{ config('app.url') }}">@if ($snipeSettings->logo!='')<img class="navbar-brand-img" src="{{ Storage::disk('public')->url($snipeSettings->logo) }}" alt="{{ $snipeSettings->site_name }} logo">@endif{{ $snipeSettings->site_name }}</a>@elseif ($snipeSettings->brand == '2')- <a class="logo navbar-brand no-hover" href="{{ url('/') }}">+ <a class="logo navbar-brand no-hover" href="{{ config('app.url') }}">@if ($snipeSettings->logo!='')<img class="navbar-brand-img" src="{{ Storage::disk('public')->url($snipeSettings->logo) }}" alt="{{ $snipeSettings->site_name }} logo">@endif<span class="sr-only">{{ $snipeSettings->site_name }}</span></a>@else- <a class="logo navbar-brand no-hover" href="{{ url('/') }}">+ <a class="logo navbar-brand no-hover" href="{{ config('app.url') }}">{{ $snipeSettings->site_name }}</a>@endifdiff --git a/resources/views/locations/print.blade.php b/resources/views/locations/print.blade.phpindex cdba0aca91..9f54978ff5 100644--- a/resources/views/locations/print.blade.php+++ b/resources/views/locations/print.blade.php@@ -36,13 +36,13 @@<h3>@if ($snipeSettings->logo!='')- <img class="print-logo" src="{{ url('/') }}/uploads/{{ $snipeSettings->logo }}">+ <img class="print-logo" src="{{ config('app.url') }}/uploads/{{ $snipeSettings->logo }}">@endif{{ $snipeSettings->site_name }}</h3>@elseif ($snipeSettings->brand == '2')@if ($snipeSettings->logo!='')- <img class="print-logo" src="{{ url('/') }}/uploads/{{ $snipeSettings->logo }}">+ <img class="print-logo" src="{{ config('app.url') }}/uploads/{{ $snipeSettings->logo }}">@endif@else<h3>{{ $snipeSettings->site_name }}</h3>diff --git a/resources/views/notifications/FirstAdmin.blade.php b/resources/views/notifications/FirstAdmin.blade.phpindex f6d9202bb2..b6d8e89db2 100644--- a/resources/views/notifications/FirstAdmin.blade.php+++ b/resources/views/notifications/FirstAdmin.blade.php@@ -10,7 +10,7 @@ Go To {{$snipeSettings->site_name}}{{ trans('mail.best_regards') }} <br>@if ($snipeSettings->show_url_in_emails=='1')- <p><a href="{{ url('/') }}">{{ $snipeSettings->site_name }}</a></p>+ <p><a href="{{ config('app.url') }}">{{ $snipeSettings->site_name }}</a></p>@else<p>{{ $snipeSettings->site_name }}</p>@endifdiff --git a/resources/views/notifications/Welcome.blade.php b/resources/views/notifications/Welcome.blade.phpindex 7501a81bb8..82dcd3e155 100644--- a/resources/views/notifications/Welcome.blade.php+++ b/resources/views/notifications/Welcome.blade.php@@ -12,7 +12,7 @@ Go To {{$snipeSettings->site_name}}{{ trans('mail.best_regards') }} <br>@if ($snipeSettings->show_url_in_emails=='1')- <p><a href="{{ url('/') }}">{{ $snipeSettings->site_name }}</a></p>+ <p><a href="{{ config('app.url') }}">{{ $snipeSettings->site_name }}</a></p>@else<p>{{ $snipeSettings->site_name }}</p>@endifdiff --git a/resources/views/partials/assets-assigned.blade.php b/resources/views/partials/assets-assigned.blade.phpindex 6e3c0f9bfd..2ec51f36b7 100644--- a/resources/views/partials/assets-assigned.blade.php+++ b/resources/views/partials/assets-assigned.blade.php@@ -13,7 +13,7 @@$.ajax({type: 'GET',- url: '{{ url('/') }}/api/v1/users/' + userid + '/assets',+ url: '{{ config('app.url') }}/api/v1/users/' + userid + '/assets',headers: {"X-Requested-With": 'XMLHttpRequest',"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')@@ -45,7 +45,7 @@} else {table_html += "<td></td> ";}- table_html += '<td><a href="{{ url('/') }}/hardware/' + asset.id + '">';+ table_html += '<td><a href="{{ config('app.url') }}/hardware/' + asset.id + '">';if ((asset.name == '') && (asset.name != null)) {table_html += " " + asset.model.name;diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.phpindex e885f2115c..9c49323760 100644--- a/resources/views/partials/bootstrap-table.blade.php+++ b/resources/views/partials/bootstrap-table.blade.php@@ -173,7 +173,7 @@function genericRowLinkFormatter(destination) {return function (value,row) {if (value) {- return '<a href="{{ url('/') }}/' + destination + '/' + row.id + '">' + value + '</a>';+ return '<a href="{{ config('app.url') }}/' + destination + '/' + row.id + '">' + value + '</a>';}};}@@ -215,7 +215,7 @@text_help = '';}- return '<nobr><a href="{{ url('/') }}/' + destination + '/' + value.id + '" data-toggle="tooltip" title="'+ status_meta[value.status_meta] + '"> <i class="fa ' + icon_style + ' text-' + text_color + '"></i> ' + value.name + ' ' + text_help + ' </a> </nobr>';+ return '<nobr><a href="{{ config('app.url') }}/' + destination + '/' + value.id + '" data-toggle="tooltip" title="'+ status_meta[value.status_meta] + '"> <i class="fa ' + icon_style + ' text-' + text_color + '"></i> ' + value.name + ' ' + text_help + ' </a> </nobr>';} else if ((value) && (value.name)) {// Add some overrides for any funny urls we have@@ -225,13 +225,13 @@var dpolymorphicItemFormatterest = 'fields/';}- return '<nobr><a href="{{ url('/') }}/' + dpolymorphicItemFormatterest + dest + '/' + value.id + '">' + value.name + '</a></span>';+ return '<nobr><a href="{{ config('app.url') }}/' + dpolymorphicItemFormatterest + dest + '/' + value.id + '">' + value.name + '</a></span>';}};}function hardwareAuditFormatter(value, row) {- return '<a href="{{ url('/') }}/hardware/audit/' + row.id + '/" class="btn btn-sm bg-yellow" data-tooltip="true" title="Audit this item">{{ trans('general.audit') }}</a>';+ return '<a href="{{ config('app.url') }}/hardware/audit/' + row.id + '/" class="btn btn-sm bg-yellow" data-tooltip="true" title="Audit this item">{{ trans('general.audit') }}</a>';}@@ -261,15 +261,15 @@}if ((row.available_actions) && (row.available_actions.clone === true)) {- actions += '<a href="{{ url('/') }}/' + dest + '/' + row.id + '/clone" class="btn btn-sm btn-info" data-tooltip="true" title="{{ trans('general.clone_item') }}"><i class="far fa-clone" aria-hidden="true"></i><span class="sr-only">Clone</span></a> ';+ actions += '<a href="{{ config('app.url') }}/' + dest + '/' + row.id + '/clone" class="btn btn-sm btn-info" data-tooltip="true" title="{{ trans('general.clone_item') }}"><i class="far fa-clone" aria-hidden="true"></i><span class="sr-only">Clone</span></a> ';}if ((row.available_actions) && (row.available_actions.update === true)) {- actions += '<a href="{{ url('/') }}/' + dest + '/' + row.id + '/edit" class="btn btn-sm btn-warning" data-tooltip="true" title="{{ trans('general.update') }}"><i class="fas fa-pencil-alt" aria-hidden="true"></i><span class="sr-only">{{ trans('general.update') }}</span></a> ';+ actions += '<a href="{{ config('app.url') }}/' + dest + '/' + row.id + '/edit" class="btn btn-sm btn-warning" data-tooltip="true" title="{{ trans('general.update') }}"><i class="fas fa-pencil-alt" aria-hidden="true"></i><span class="sr-only">{{ trans('general.update') }}</span></a> ';}if ((row.available_actions) && (row.available_actions.delete === true)) {- actions += '<a href="{{ url('/') }}/' + dest + '/' + row.id + '" '+ actions += '<a href="{{ config('app.url') }}/' + dest + '/' + row.id + '" '+ ' class="btn btn-danger btn-sm delete-asset" data-toggle="tooltip" '+ ' data-toggle="modal" '+ ' data-content="{{ trans('general.sure_to_delete') }} ' + row.name + '?" '@@ -281,7 +281,7 @@if ((row.available_actions) && (row.available_actions.restore === true)) {- actions += '<form style="display: inline;" method="POST" action="{{ url('/') }}/' + dest + '/' + row.id + '/restore"> ';+ actions += '<form style="display: inline;" method="POST" action="{{ config('app.url') }}/' + dest + '/' + row.id + '/restore"> ';actions += '@csrf';actions += '<button class="btn btn-sm btn-warning" data-toggle="tooltip" title="{{ trans('general.restore') }}"><i class="fas fa-retweet"></i></button> ';}@@ -332,7 +332,7 @@value.name = value.name + ' (' + value.username + ')';}- return '<nobr><a href="{{ url('/') }}/' + item_destination +'/' + value.id + '" data-tooltip="true" title="' + value.type + '"><i class="' + item_icon + ' text-{{ $snipeSettings->skin!='' ? $snipeSettings->skin : 'blue' }} "></i> ' + value.name + '</a></nobr>';+ return '<nobr><a href="{{ config('app.url') }}/' + item_destination +'/' + value.id + '" data-tooltip="true" title="' + value.type + '"><i class="' + item_icon + ' text-{{ $snipeSettings->skin!='' ? $snipeSettings->skin : 'blue' }} "></i> ' + value.name + '</a></nobr>';} else {return '';@@ -364,9 +364,9 @@function licenseSeatInOutFormatter(value, row) {// The user is allowed to check the license seat out and it's availableif ((row.available_actions.checkout == true) && (row.user_can_checkout == true) && ((!row.asset_id) && (!row.assigned_to))) {- return '<a href="{{ url('/') }}/licenses/' + row.license_id + '/checkout/'+row.id+'" class="btn btn-sm bg-maroon" data-toggle="tooltip" title="{{ trans('general.checkout_tooltip') }}">{{ trans('general.checkout') }}</a>';+ return '<a href="{{ config('app.url') }}/licenses/' + row.license_id + '/checkout/'+row.id+'" class="btn btn-sm bg-maroon" data-toggle="tooltip" title="{{ trans('general.checkout_tooltip') }}">{{ trans('general.checkout') }}</a>';} else {- return '<a href="{{ url('/') }}/licenses/' + row.id + '/checkin" class="btn btn-sm bg-purple" data-toggle="tooltip" title="Check in this license seat.">{{ trans('general.checkin') }}</a>';+ return '<a href="{{ config('app.url') }}/licenses/' + row.id + '/checkin" class="btn btn-sm bg-purple" data-toggle="tooltip" title="Check in this license seat.">{{ trans('general.checkin') }}</a>';}}@@ -376,7 +376,7 @@// The user is allowed to check items out, AND the item is deployableif ((row.available_actions.checkout == true) && (row.user_can_checkout == true) && ((!row.asset_id) && (!row.assigned_to))) {- return '<a href="{{ url('/') }}/' + destination + '/' + row.id + '/checkout" class="btn btn-sm bg-maroon" data-toggle="tooltip" title="{{ trans('general.checkout_tooltip') }}">{{ trans('general.checkout') }}</a>';+ return '<a href="{{ config('app.url') }}/' + destination + '/' + row.id + '/checkout" class="btn btn-sm bg-maroon" data-toggle="tooltip" title="{{ trans('general.checkout_tooltip') }}">{{ trans('general.checkout') }}</a>';// The user is allowed to check items out, but the item is not deployable} else if (((row.user_can_checkout == false)) && (row.available_actions.checkout == true) && (!row.assigned_to)) {@@ -385,9 +385,9 @@// The user is allowed to check items in} else if (row.available_actions.checkin == true) {if (row.assigned_to) {- return '<a href="{{ url('/') }}/' + destination + '/' + row.id + '/checkin" class="btn btn-sm bg-purple" data-toggle="tooltip" title="Check this item in so it is available for re-imaging, re-issue, etc.">{{ trans('general.checkin') }}</a>';+ return '<a href="{{ config('app.url') }}/' + destination + '/' + row.id + '/checkin" class="btn btn-sm bg-purple" data-toggle="tooltip" title="Check this item in so it is available for re-imaging, re-issue, etc.">{{ trans('general.checkin') }}</a>';} else if (row.assigned_pivot_id) {- return '<a href="{{ url('/') }}/' + destination + '/' + row.assigned_pivot_id + '/checkin" class="btn btn-sm bg-purple" data-toggle="tooltip" title="Check this item in so it is available for re-imaging, re-issue, etc.">{{ trans('general.checkin') }}</a>';+ return '<a href="{{ config('app.url') }}/' + destination + '/' + row.assigned_pivot_id + '/checkin" class="btn btn-sm bg-purple" data-toggle="tooltip" title="Check this item in so it is available for re-imaging, re-issue, etc.">{{ trans('general.checkin') }}</a>';}}@@ -403,9 +403,9 @@if (value.assigned_to_self == true){return '<button class="btn btn-danger btn-sm disabled" data-toggle="tooltip" title="Cancel this item request">{{ trans('button.cancel') }}</button>';} else if (value.available_actions.cancel == true) {- return '<form action="{{ url('/') }}/account/request-asset/'+ value.id + '" method="POST">@csrf<button class="btn btn-danger btn-sm" data-toggle="tooltip" title="Cancel this item request">{{ trans('button.cancel') }}</button></form>';+ return '<form action="{{ config('app.url') }}/account/request-asset/'+ value.id + '" method="POST">@csrf<button class="btn btn-danger btn-sm" data-toggle="tooltip" title="Cancel this item request">{{ trans('button.cancel') }}</button></form>';} else if (value.available_actions.request == true) {- return '<form action="{{ url('/') }}/account/request-asset/'+ value.id + '" method="POST">@csrf<button class="btn btn-primary btn-sm" data-toggle="tooltip" title="Request this item">{{ trans('button.request') }}</button></form>';+ return '<form action="{{ config('app.url') }}/account/request-asset/'+ value.id + '" method="POST">@csrf<button class="btn btn-primary btn-sm" data-toggle="tooltip" title="Request this item">{{ trans('button.request') }}</button></form>';}}@@ -506,7 +506,7 @@if (value) {var groups = '';for (var index in value.rows) {- groups += '<a href="{{ url('/') }}/admin/groups/' + value.rows[index].id + '" class="label label-default">' + value.rows[index].name + '</a> ';+ groups += '<a href="{{ config('app.url') }}/admin/groups/' + value.rows[index].id + '" class="label label-default">' + value.rows[index].name + '</a> ';}return groups;}@@ -535,20 +535,20 @@function deployedLocationFormatter(row, value) {if ((row) && (row!=undefined)) {- return '<a href="{{ url('/') }}/locations/' + row.id + '">' + row.name + '</a>';+ return '<a href="{{ config('app.url') }}/locations/' + row.id + '">' + row.name + '</a>';} else if (value.rtd_location) {- return '<a href="{{ url('/') }}/locations/' + value.rtd_location.id + '" data-toggle="tooltip" title="Default Location">' + value.rtd_location.name + '</a>';+ return '<a href="{{ config('app.url') }}/locations/' + value.rtd_location.id + '" data-toggle="tooltip" title="Default Location">' + value.rtd_location.name + '</a>';}}function groupsAdminLinkFormatter(value, row) {- return '<a href="{{ url('/') }}/admin/groups/' + row.id + '">' + value + '</a>';+ return '<a href="{{ config('app.url') }}/admin/groups/' + row.id + '">' + value + '</a>';}function assetTagLinkFormatter(value, row) {if ((row.asset) && (row.asset.id)) {- return '<a href="{{ url('/') }}/hardware/' + row.asset.id + '">' + row.asset.asset_tag + '</a>';+ return '<a href="{{ config('app.url') }}/hardware/' + row.asset.id + '">' + row.asset.asset_tag + '</a>';}return '';@@ -556,14 +556,14 @@function departmentNameLinkFormatter(value, row) {if ((row.assigned_user) && (row.assigned_user.department) && (row.assigned_user.department.name)) {- return '<a href="{{ url('/') }}/department/' + row.assigned_user.department.id + '">' + row.assigned_user.department.name + '</a>';+ return '<a href="{{ config('app.url') }}/department/' + row.assigned_user.department.id + '">' + row.assigned_user.department.name + '</a>';}}function assetNameLinkFormatter(value, row) {if ((row.asset) && (row.asset.name)) {- return '<a href="{{ url('/') }}/hardware/' + row.asset.id + '">' + row.asset.name + '</a>';+ return '<a href="{{ config('app.url') }}/hardware/' + row.asset.id + '">' + row.asset.name + '</a>';}}@@ -602,19 +602,19 @@function assetCompanyFilterFormatter(value, row) {if (value) {- return '<a href="{{ url('/') }}/hardware/?company_id=' + row.id + '">' + value + '</a>';+ return '<a href="{{ config('app.url') }}/hardware/?company_id=' + row.id + '">' + value + '</a>';}}function assetCompanyObjFilterFormatter(value, row) {if ((row) && (row.company)) {- return '<a href="{{ url('/') }}/hardware/?company_id=' + row.company.id + '">' + row.company.name + '</a>';+ return '<a href="{{ config('app.url') }}/hardware/?company_id=' + row.company.id + '">' + row.company.name + '</a>';}}function usersCompanyObjFilterFormatter(value, row) {if (value) {- return '<a href="{{ url('/') }}/users/?company_id=' + row.id + '">' + value + '</a>';+ return '<a href="{{ config('app.url') }}/users/?company_id=' + row.id + '">' + value + '</a>';} else {return value;}@@ -623,13 +623,13 @@function employeeNumFormatter(value, row) {if ((row) && (row.assigned_to) && ((row.assigned_to.employee_number))) {- return '<a href="{{ url('/') }}/users/' + row.assigned_to.id + '">' + row.assigned_to.employee_number + '</a>';+ return '<a href="{{ config('app.url') }}/users/' + row.assigned_to.id + '">' + row.assigned_to.employee_number + '</a>';}}function orderNumberObjFilterFormatter(value, row) {if (value) {- return '<a href="{{ url('/') }}/hardware/?order_number=' + row.order_number + '">' + row.order_number + '</a>';+ return '<a href="{{ config('app.url') }}/hardware/?order_number=' + row.order_number + '">' + row.order_number + '</a>';}}diff --git a/resources/views/settings/saml.blade.php b/resources/views/settings/saml.blade.phpindex 09990db2e9..e2d93acfa3 100644--- a/resources/views/settings/saml.blade.php+++ b/resources/views/settings/saml.blade.php@@ -67,7 +67,7 @@<!-- SAML SP Details --><!-- SAML SP Entity ID -->{{ Form::label('saml_sp_entitiyid', trans('admin/settings/general.saml_sp_entityid')) }}- {{ Form::text('saml_sp_entitiyid', url('/'), ['class' => 'form-control', 'readonly']) }}+ {{ Form::text('saml_sp_entitiyid', config('app.url'), ['class' => 'form-control', 'readonly']) }}<br><!-- SAML SP ACS -->{{ Form::label('saml_sp_acs_url', trans('admin/settings/general.saml_sp_acs_url')) }}diff --git a/resources/views/setup/done.blade.php b/resources/views/setup/done.blade.phpindex 470c4b0b10..f0a0b48509 100644--- a/resources/views/setup/done.blade.php+++ b/resources/views/setup/done.blade.php@@ -14,6 +14,6 @@{{ trans('general.create_admin_success') }}</div></div>- <p>{{ trans('general.create_admin_redirect') }} <a href="{{ url('/') }}">{{ url('/') }}</a></p>+ <p>{{ trans('general.create_admin_redirect') }} <a href="{{ config('app.url') }}">{{ config('app.url') }}</a></p></div>@stopdiff --git a/resources/views/statuslabels/index.blade.php b/resources/views/statuslabels/index.blade.phpindex 77858b4da4..1f24d32d9a 100755--- a/resources/views/statuslabels/index.blade.php+++ b/resources/views/statuslabels/index.blade.php@@ -106,7 +106,7 @@function statuslabelsAssetLinkFormatter(value, row) {if ((row) && (row.name)) {- return '<a href="{{ url('/') }}/hardware/?status_id=' + row.id + '"> ' + row.name + '</a>';+ return '<a href="{{ config('app.url') }}/hardware/?status_id=' + row.id + '"> ' + row.name + '</a>';}}diff --git a/resources/views/users/print.blade.php b/resources/views/users/print.blade.phpindex ebcfd170bd..0f1e8a9097 100644--- a/resources/views/users/print.blade.php+++ b/resources/views/users/print.blade.php@@ -36,13 +36,13 @@<h2>@if ($snipeSettings->logo!='')- <img class="print-logo" src="{{ url('/') }}/uploads/{{ $snipeSettings->logo }}">+ <img class="print-logo" src="{{ config('app.url') }}/uploads/{{ $snipeSettings->logo }}">@endif{{ $snipeSettings->site_name }}</h2>@elseif ($snipeSettings->brand == '2')@if ($snipeSettings->logo!='')- <img class="print-logo" src="{{ url('/') }}/uploads/{{ $snipeSettings->logo }}">+ <img class="print-logo" src="{{ config('app.url') }}/uploads/{{ $snipeSettings->logo }}">@endif@else<h2>{{ $snipeSettings->site_name }}</h2>diff --git a/resources/views/vendor/mail/markdown/message.blade.php b/resources/views/vendor/mail/markdown/message.blade.phpindex 0fcfba938c..e2f953e2a6 100644--- a/resources/views/vendor/mail/markdown/message.blade.php+++ b/resources/views/vendor/mail/markdown/message.blade.php@@ -6,13 +6,13 @@@if ($snipeSettings->brand == '3')@if ($snipeSettings->logo!='')-<img class="navbar-brand-img logo" src="{{ url('/') }}/uploads/{{ $snipeSettings->logo }}">+<img class="navbar-brand-img logo" src="{{ config('app.url') }}/uploads/{{ $snipeSettings->logo }}">@endif{{ $snipeSettings->site_name }}@elseif ($snipeSettings->brand == '2')@if ($snipeSettings->logo!='')-<img class="navbar-brand-img logo" src="{{ url('/') }}/uploads/{{ $snipeSettings->logo }}">+<img class="navbar-brand-img logo" src="{{ config('app.url') }}/uploads/{{ $snipeSettings->logo }}">@endif@else{{ $snipeSettings->site_name }}diff --git a/resources/views/vendor/notifications/email.blade.php b/resources/views/vendor/notifications/email.blade.phpindex f25cfcec8c..905dc25296 100644--- a/resources/views/vendor/notifications/email.blade.php+++ b/resources/views/vendor/notifications/email.blade.php@@ -86,13 +86,13 @@ $style = [@if ($snipeSettings->brand == '3')@if ($logo!='')- <img class="navbar-brand-img logo" style="max-width: 50px;" src="{{ url('/') }}/uploads/{{ $logo }}">+ <img class="navbar-brand-img logo" style="max-width: 50px;" src="{{ config('app.url') }}/uploads/{{ $logo }}">@endif{{ $snipeSettings->site_name }}@elseif ($snipeSettings->brand == '2')@if ($logo!='')- <img class="navbar-brand-img logo" style="max-width: 50px;" src="{{ url('/') }}/uploads/{{ $logo }}">+ <img class="navbar-brand-img logo" style="max-width: 50px;" src="{{ config('app.url') }}/uploads/{{ $logo }}">@endif@else{{ $snipeSettings->site_name }}@@ -203,7 +203,7 @@ $style = [<td style="{{ $fontFamily }} {{ $style['email-footer_cell'] }}"><p style="{{ $style['paragraph-sub'] }}">© {{ date('Y') }}- <a style="{{ $style['anchor'] }}" href="{{ url('/') }}" target="_blank">{{ $snipeSettings->site_name }}</a>.+ <a style="{{ $style['anchor'] }}" href="{{ config('app.url') }}" target="_blank">{{ $snipeSettings->site_name }}</a>.{{ trans('mail.rights_reserved') }}</p>