diff --git a/.all-contributorsrc b/.all-contributorsrc
index 42a34dab5..dd090262e 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -2882,6 +2882,13 @@
"contributions": [
"code"
]
+ },
+ {
+ "login": "Mezzle",
+ "name": "Martin Meredith",
+ "avatar_url": "https://avatars.githubusercontent.com/u/570639?v=4",
+ "profile": "https://github.com/Mezzle",
+ "contributions": []
}
]
}
diff --git a/README.md b/README.md
index 4c569520c..3a0d37998 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
 [](https://crowdin.com/project/snipe-it) [](https://hub.docker.com/r/snipe/snipe-it/) [](https://twitter.com/snipeitapp) [](https://www.codacy.com/app/snipe/snipe-it?utm_source=github.com&utm_medium=referral&utm_content=snipe/snipe-it&utm_campaign=Badge_Grade)
-[](#contributors) [](https://discord.gg/yZFtShAcKk) [](https://huntr.dev)
+[](#contributors) [](https://discord.gg/yZFtShAcKk) [](https://huntr.dev)
## Snipe-IT - Open Source Asset Management System
@@ -144,7 +144,7 @@ Thanks goes to all of these wonderful people ([emoji key](https://github.com/ken
| [
Peace](https://github.com/julian-piehl)
[💻](https://github.com/snipe/snipe-it/commits?author=julian-piehl "Code") | [
Kyle Gordon](https://github.com/kylegordon)
[💻](https://github.com/snipe/snipe-it/commits?author=kylegordon "Code") | [
Katharina Drexel](http://www.bfh.ch)
[💻](https://github.com/snipe/snipe-it/commits?author=sunflowerbofh "Code") | [
David Sferruzza](https://david.sferruzza.fr/)
[💻](https://github.com/snipe/snipe-it/commits?author=dsferruzza "Code") | [
Rick Nelson](https://github.com/rnelsonee)
[💻](https://github.com/snipe/snipe-it/commits?author=rnelsonee "Code") | [
BasO12](https://github.com/BasO12)
[💻](https://github.com/snipe/snipe-it/commits?author=BasO12 "Code") | [
Vautia](https://github.com/Vautia)
[💻](https://github.com/snipe/snipe-it/commits?author=Vautia "Code") |
| [
Chris Hartjes](http://www.littlehart.net/atthekeyboard)
[💻](https://github.com/snipe/snipe-it/commits?author=chartjes "Code") | [
geo-chen](https://github.com/geo-chen)
[💻](https://github.com/snipe/snipe-it/commits?author=geo-chen "Code") | [
Phan Nguyen](https://github.com/nh314)
[💻](https://github.com/snipe/snipe-it/commits?author=nh314 "Code") | [
Iisakki Jaakkola](https://github.com/StarlessNights)
[💻](https://github.com/snipe/snipe-it/commits?author=StarlessNights "Code") | [
Ikko Ashimine](https://bandism.net/)
[💻](https://github.com/snipe/snipe-it/commits?author=eltociear "Code") | [
Lukas Fehling](https://github.com/lukasfehling)
[💻](https://github.com/snipe/snipe-it/commits?author=lukasfehling "Code") | [
Fernando Almeida](https://github.com/fernando-almeida)
[💻](https://github.com/snipe/snipe-it/commits?author=fernando-almeida "Code") |
| [
akemidx](https://github.com/akemidx)
[💻](https://github.com/snipe/snipe-it/commits?author=akemidx "Code") | [
Oguz Bilgic](http://oguz.site)
[💻](https://github.com/snipe/snipe-it/commits?author=oguzbilgic "Code") | [
Scooter Crawford](https://github.com/scoo73r)
[💻](https://github.com/snipe/snipe-it/commits?author=scoo73r "Code") | [
subdriven](https://github.com/subdriven)
[💻](https://github.com/snipe/snipe-it/commits?author=subdriven "Code") | [
Andrew Savinykh](https://github.com/AndrewSav)
[💻](https://github.com/snipe/snipe-it/commits?author=AndrewSav "Code") | [
Tadayuki Onishi](https://kenchan0130.github.io)
[💻](https://github.com/snipe/snipe-it/commits?author=kenchan0130 "Code") | [
Florian](https://github.com/floschoepfer)
[💻](https://github.com/snipe/snipe-it/commits?author=floschoepfer "Code") |
-| [
Spencer Long](http://spencerlong.com)
[💻](https://github.com/snipe/snipe-it/commits?author=spencerrlongg "Code") | [
Marcus Moore](https://github.com/marcusmoore)
[💻](https://github.com/snipe/snipe-it/commits?author=marcusmoore "Code") |
+| [
Spencer Long](http://spencerlong.com)
[💻](https://github.com/snipe/snipe-it/commits?author=spencerrlongg "Code") | [
Marcus Moore](https://github.com/marcusmoore)
[💻](https://github.com/snipe/snipe-it/commits?author=marcusmoore "Code") | [
Martin Meredith](https://github.com/Mezzle)
|
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
index 96d761ef5..c0e9454d6 100644
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -9,11 +9,11 @@
*
* **THIS DOCUMENTATION DOES NOT COVER INSTALLATION.** If you're here and you're not a
* developer, you're probably in the wrong place. Please see the
- * [Installation documentation](http://docs.snipeitapp.com) for
+ * [Installation documentation](https://snipe-it.readme.io) for
* information on how to install Snipe-IT.
*
* To learn how to set up a development environment and get started developing for Snipe-IT,
- * please see the [contributing documentation](http://docs.snipeitapp.com/contributing.html).
+ * please see the [contributing documentation](https://snipe-it.readme.io/docs/contributing-overview).
*
* Only the Snipe-IT specific controllers, models, helpers, service providers,
* etc have been included in this documentation (excluding vendors, Laravel core, etc)
diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php
index 1deaa5d10..f16a6fc8f 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.php
index b4beb7058..4e399ffcf 100644
--- a/app/Http/Middleware/CheckForSetup.php
+++ b/app/Http/Middleware/CheckForSetup.php
@@ -20,13 +20,13 @@ class CheckForSetup
if (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/Asset.php b/app/Models/Asset.php
index e992298d8..a5211e800 100644
--- a/app/Models/Asset.php
+++ b/app/Models/Asset.php
@@ -70,19 +70,6 @@ class Asset extends Depreciable
*/
protected $injectUniqueIdentifier = true;
- // We set these as protected dates so that they will be easily accessible via Carbon
- protected $dates = [
- 'created_at',
- 'updated_at',
- 'deleted_at',
- 'purchase_date',
- 'last_checkout',
- 'expected_checkin',
- 'last_audit_date',
- 'next_audit_date'
- ];
-
-
protected $casts = [
'purchase_date' => 'date',
'last_checkout' => 'datetime',
@@ -96,6 +83,9 @@ class Asset extends Depreciable
'rtd_company_id' => 'integer',
'supplier_id' => 'integer',
'byod' => 'boolean',
+ 'created_at' => 'datetime',
+ 'updated_at' => 'datetime',
+ 'deleted_at' => 'datetime',
];
protected $rules = [
diff --git a/app/Models/Location.php b/app/Models/Location.php
index 8181f406c..8cea9bda1 100755
--- a/app/Models/Location.php
+++ b/app/Models/Location.php
@@ -267,7 +267,7 @@ class Location extends SnipeModel
foreach ($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/Models/User.php b/app/Models/User.php
index bf40982db..c716da074 100644
--- a/app/Models/User.php
+++ b/app/Models/User.php
@@ -73,18 +73,13 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
'location_id' => 'integer',
'company_id' => 'integer',
'vip' => 'boolean',
+ 'created_at' => 'datetime',
+ 'updated_at' => 'datetime',
+ 'deleted_at' => 'datetime',
+ 'start_date' => 'datetime:Y-m-d',
+ 'end_date' => 'datetime:Y-m-d',
];
-
- protected $dates = [
- 'created_at',
- 'updated_at',
- 'deleted_at',
- 'start_date' => 'date_format:Y-m-d',
- 'end_date' => 'date_format:Y-m-d',
- ];
-
-
/**
* Model validation rules
*
diff --git a/app/Notifications/FirstAdminNotification.php b/app/Notifications/FirstAdminNotification.php
index 71637b5e8..83e3a65de 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.php
index a5754be4d..1e27ca736 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.php
index fd74108ee..8e3d10904 100644
--- a/app/Presenters/AssetModelPresenter.php
+++ b/app/Presenters/AssetModelPresenter.php
@@ -210,7 +210,7 @@ class AssetModelPresenter extends Presenter
public function imageUrl()
{
if (! empty($this->image)) {
- return '';
+ return '
';
}
return '';
@@ -223,7 +223,7 @@ class AssetModelPresenter extends Presenter
public 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.php
index 4bfe4492f..b5eefdf81 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.php
index 3f39be29f..f80b1c1fb 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 proxy
OneLogin_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/crowdin.yml b/crowdin.yml
index 4eccb2adb..7abe441e4 100644
--- a/crowdin.yml
+++ b/crowdin.yml
@@ -3,6 +3,7 @@
"files": [
{
"source" : "/resources/lang/en/**/*.php",
- "translation" : "/resources/lang/%locale%/%original_file_name%"
+ # https://developer.crowdin.com/configuration-file/#placeholders
+ "translation" : "/resources/lang/%locale%/**/%original_file_name%"
}
]
diff --git a/resources/views/account/requestable-assets.blade.php b/resources/views/account/requestable-assets.blade.php
index 002fc4dc5..ceadd2e37 100644
--- a/resources/views/account/requestable-assets.blade.php
+++ b/resources/views/account/requestable-assets.blade.php
@@ -104,8 +104,8 @@
- Sad panda. You are not authorized to do the thing. Maybe return to the dashboard, or contact your administrator. + Sad panda. You are not authorized to do the thing. Maybe return to the dashboard, or contact your administrator.
Sad panda. We could not find the page you were looking for. - You should maybe return to the dashboard. + You should maybe return to the dashboard.
© {{ date('Y') }} - {{ $snipeSettings->site_name }}. + {{ $snipeSettings->site_name }}. {{ trans('mail.rights_reserved') }}
diff --git a/stubs/test.stub b/stubs/test.stub new file mode 100644 index 000000000..06b35d3e1 --- /dev/null +++ b/stubs/test.stub @@ -0,0 +1,13 @@ +