From 22e13cd4d221d412b86c44f541d60daa44c6925a Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 19 Oct 2017 17:15:21 -0700 Subject: [PATCH 1/6] Allow sorting on asset counts, disable delete button if the user has items checked out to them --- app/Http/Controllers/Api/UsersController.php | 3 ++- app/Http/Transformers/UsersTransformer.php | 2 +- app/Presenters/UserPresenter.php | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index f3be10cf7a..7ae2e20d22 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -92,7 +92,8 @@ class UsersController extends Controller [ 'last_name','first_name','email','jobtitle','username','employee_num', 'assets','accessories', 'consumables','licenses','groups','activated','created_at', - 'two_factor_enrolled','two_factor_optin','last_login' + 'two_factor_enrolled','two_factor_optin','last_login', 'assets_count', 'licenses_count', + 'consumables_count', 'accessories_count' ]; $sort = in_array($request->get('sort'), $allowed_columns) ? $request->get('sort') : 'first_name'; diff --git a/app/Http/Transformers/UsersTransformer.php b/app/Http/Transformers/UsersTransformer.php index 406dd372d9..2db1d1c801 100644 --- a/app/Http/Transformers/UsersTransformer.php +++ b/app/Http/Transformers/UsersTransformer.php @@ -58,7 +58,7 @@ class UsersTransformer $permissions_array['available_actions'] = [ 'update' => (Gate::allows('update', User::class) && ($user->deleted_at=='')) ? true : false, - 'delete' => (Gate::allows('delete', User::class) && ($user->deleted_at=='')) ? true : false, + 'delete' => (Gate::allows('delete', User::class) && ($user->deleted_at=='') && ($user->assets_count == 0) && ($user->licenses_count == 0) && ($user->accessories_count == 0) && ($user->consumables_count == 0)) ? true : false, 'clone' => (Gate::allows('create', User::class) && ($user->deleted_at=='')) , 'restore' => (Gate::allows('create', User::class) && ($user->deleted_at!='')) ? true : false, ]; diff --git a/app/Presenters/UserPresenter.php b/app/Presenters/UserPresenter.php index 9460ea23d6..5ff2f0d179 100644 --- a/app/Presenters/UserPresenter.php +++ b/app/Presenters/UserPresenter.php @@ -115,7 +115,7 @@ class UserPresenter extends Presenter [ "field" => "assets_count", "searchable" => false, - "sortable" => false, + "sortable" => true, "switchable" => true, "title" => ' ' .'', @@ -124,7 +124,7 @@ class UserPresenter extends Presenter [ "field" => "licenses_count", "searchable" => false, - "sortable" => false, + "sortable" => true, "switchable" => true, "title" => ' ' .'', @@ -133,7 +133,7 @@ class UserPresenter extends Presenter [ "field" => "consumables_count", "searchable" => false, - "sortable" => false, + "sortable" => true, "switchable" => true, "title" => ' ' .'', @@ -142,7 +142,7 @@ class UserPresenter extends Presenter [ "field" => "accessories_count", "searchable" => false, - "sortable" => false, + "sortable" => true, "switchable" => true, "title" => ' ' .'', From abcce789442a509c199c7bfdefc4afc747677004 Mon Sep 17 00:00:00 2001 From: Nicolai Essig Date: Fri, 20 Oct 2017 09:20:33 +0200 Subject: [PATCH 2/6] use translation for "All" in sidebar menu (#4268) --- resources/views/layouts/default.blade.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php index d30dd16c8a..37077f908e 100644 --- a/resources/views/layouts/default.blade.php +++ b/resources/views/layouts/default.blade.php @@ -379,16 +379,16 @@ - All @lang('general.deployed') + @lang('general.all') @lang('general.deployed') - All @lang('general.ready_to_deploy') + @lang('general.all') @lang('general.ready_to_deploy') - All @lang('general.pending') - All @lang('general.undeployable') - All @lang('admin/hardware/general.archived') + @lang('general.all') @lang('general.pending') + @lang('general.all') @lang('general.undeployable') + @lang('general.all') @lang('admin/hardware/general.archived') @lang('admin/hardware/general.requestable')
  •  
  • From 341ddec9d8362478d5a3846f99c07d3e8daf2946 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 20 Oct 2017 16:52:12 -0700 Subject: [PATCH 3/6] Adds built-in mail notification vendor templates --- config/mail.php | 5 +- .../views/vendor/mail/html/button.blade.php | 19 ++ .../views/vendor/mail/html/footer.blade.php | 11 + .../views/vendor/mail/html/header.blade.php | 7 + .../views/vendor/mail/html/layout.blade.php | 54 ++++ .../views/vendor/mail/html/message.blade.php | 27 ++ .../views/vendor/mail/html/panel.blade.php | 13 + .../vendor/mail/html/promotion.blade.php | 7 + .../mail/html/promotion/button.blade.php | 13 + .../views/vendor/mail/html/subcopy.blade.php | 7 + .../views/vendor/mail/html/table.blade.php | 3 + .../views/vendor/mail/html/themes/default.css | 285 ++++++++++++++++++ .../vendor/mail/markdown/button.blade.php | 1 + .../vendor/mail/markdown/footer.blade.php | 5 + .../vendor/mail/markdown/header.blade.php | 6 + .../vendor/mail/markdown/layout.blade.php | 9 + .../vendor/mail/markdown/message.blade.php | 27 ++ .../vendor/mail/markdown/panel.blade.php | 1 + .../vendor/mail/markdown/promotion.blade.php | 1 + .../mail/markdown/promotion/button.blade.php | 1 + .../vendor/mail/markdown/subcopy.blade.php | 1 + .../vendor/mail/markdown/table.blade.php | 1 + 22 files changed, 500 insertions(+), 4 deletions(-) create mode 100644 resources/views/vendor/mail/html/button.blade.php create mode 100644 resources/views/vendor/mail/html/footer.blade.php create mode 100644 resources/views/vendor/mail/html/header.blade.php create mode 100644 resources/views/vendor/mail/html/layout.blade.php create mode 100644 resources/views/vendor/mail/html/message.blade.php create mode 100644 resources/views/vendor/mail/html/panel.blade.php create mode 100644 resources/views/vendor/mail/html/promotion.blade.php create mode 100644 resources/views/vendor/mail/html/promotion/button.blade.php create mode 100644 resources/views/vendor/mail/html/subcopy.blade.php create mode 100644 resources/views/vendor/mail/html/table.blade.php create mode 100644 resources/views/vendor/mail/html/themes/default.css create mode 100644 resources/views/vendor/mail/markdown/button.blade.php create mode 100644 resources/views/vendor/mail/markdown/footer.blade.php create mode 100644 resources/views/vendor/mail/markdown/header.blade.php create mode 100644 resources/views/vendor/mail/markdown/layout.blade.php create mode 100644 resources/views/vendor/mail/markdown/message.blade.php create mode 100644 resources/views/vendor/mail/markdown/panel.blade.php create mode 100644 resources/views/vendor/mail/markdown/promotion.blade.php create mode 100644 resources/views/vendor/mail/markdown/promotion/button.blade.php create mode 100644 resources/views/vendor/mail/markdown/subcopy.blade.php create mode 100644 resources/views/vendor/mail/markdown/table.blade.php diff --git a/config/mail.php b/config/mail.php index f975f9d788..170458955b 100755 --- a/config/mail.php +++ b/config/mail.php @@ -132,12 +132,9 @@ return [ 'sendmail' => '/usr/sbin/sendmail -bs', - - - + 'markdown' => [ 'theme' => 'default', - 'paths' => [ resource_path('views/vendor/mail'), ], diff --git a/resources/views/vendor/mail/html/button.blade.php b/resources/views/vendor/mail/html/button.blade.php new file mode 100644 index 0000000000..c7aae1b885 --- /dev/null +++ b/resources/views/vendor/mail/html/button.blade.php @@ -0,0 +1,19 @@ + + + + +
    + + + + +
    + + + + +
    + {{ $slot }} +
    +
    +
    diff --git a/resources/views/vendor/mail/html/footer.blade.php b/resources/views/vendor/mail/html/footer.blade.php new file mode 100644 index 0000000000..c3f9360abd --- /dev/null +++ b/resources/views/vendor/mail/html/footer.blade.php @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/resources/views/vendor/mail/html/header.blade.php b/resources/views/vendor/mail/html/header.blade.php new file mode 100644 index 0000000000..eefabab924 --- /dev/null +++ b/resources/views/vendor/mail/html/header.blade.php @@ -0,0 +1,7 @@ + + + + {{ $slot }} + + + diff --git a/resources/views/vendor/mail/html/layout.blade.php b/resources/views/vendor/mail/html/layout.blade.php new file mode 100644 index 0000000000..991ae52a88 --- /dev/null +++ b/resources/views/vendor/mail/html/layout.blade.php @@ -0,0 +1,54 @@ + + + + + + + + + + + + + +
    + + {{ $header or '' }} + + + + + + + {{ $footer or '' }} +
    + + + + + +
    + {{ Illuminate\Mail\Markdown::parse($slot) }} + + {{ $subcopy or '' }} +
    +
    +
    + + diff --git a/resources/views/vendor/mail/html/message.blade.php b/resources/views/vendor/mail/html/message.blade.php new file mode 100644 index 0000000000..2ad23a66e2 --- /dev/null +++ b/resources/views/vendor/mail/html/message.blade.php @@ -0,0 +1,27 @@ +@component('mail::layout') + {{-- Header --}} + @slot('header') + @component('mail::header', ['url' => config('app.url')]) + {{ config('app.name') }} + @endcomponent + @endslot + + {{-- Body --}} + {{ $slot }} + + {{-- Subcopy --}} + @isset($subcopy) + @slot('subcopy') + @component('mail::subcopy') + {{ $subcopy }} + @endcomponent + @endslot + @endisset + + {{-- Footer --}} + @slot('footer') + @component('mail::footer') + © {{ date('Y') }} {{ config('app.name') }}. All rights reserved. + @endcomponent + @endslot +@endcomponent diff --git a/resources/views/vendor/mail/html/panel.blade.php b/resources/views/vendor/mail/html/panel.blade.php new file mode 100644 index 0000000000..f397080206 --- /dev/null +++ b/resources/views/vendor/mail/html/panel.blade.php @@ -0,0 +1,13 @@ + + + + +
    + + + + +
    + {{ Illuminate\Mail\Markdown::parse($slot) }} +
    +
    diff --git a/resources/views/vendor/mail/html/promotion.blade.php b/resources/views/vendor/mail/html/promotion.blade.php new file mode 100644 index 0000000000..0debcf8a38 --- /dev/null +++ b/resources/views/vendor/mail/html/promotion.blade.php @@ -0,0 +1,7 @@ + + + + +
    + {{ Illuminate\Mail\Markdown::parse($slot) }} +
    diff --git a/resources/views/vendor/mail/html/promotion/button.blade.php b/resources/views/vendor/mail/html/promotion/button.blade.php new file mode 100644 index 0000000000..8e79081c52 --- /dev/null +++ b/resources/views/vendor/mail/html/promotion/button.blade.php @@ -0,0 +1,13 @@ + + + + +
    + + + + +
    + {{ $slot }} +
    +
    diff --git a/resources/views/vendor/mail/html/subcopy.blade.php b/resources/views/vendor/mail/html/subcopy.blade.php new file mode 100644 index 0000000000..c3df7b4c0a --- /dev/null +++ b/resources/views/vendor/mail/html/subcopy.blade.php @@ -0,0 +1,7 @@ + + + + +
    + {{ Illuminate\Mail\Markdown::parse($slot) }} +
    diff --git a/resources/views/vendor/mail/html/table.blade.php b/resources/views/vendor/mail/html/table.blade.php new file mode 100644 index 0000000000..a5f3348b23 --- /dev/null +++ b/resources/views/vendor/mail/html/table.blade.php @@ -0,0 +1,3 @@ +
    +{{ Illuminate\Mail\Markdown::parse($slot) }} +
    diff --git a/resources/views/vendor/mail/html/themes/default.css b/resources/views/vendor/mail/html/themes/default.css new file mode 100644 index 0000000000..20659933ca --- /dev/null +++ b/resources/views/vendor/mail/html/themes/default.css @@ -0,0 +1,285 @@ +/* Base */ + +body, body *:not(html):not(style):not(br):not(tr):not(code) { + font-family: Avenir, Helvetica, sans-serif; + box-sizing: border-box; +} + +body { + background-color: #f5f8fa; + color: #74787E; + height: 100%; + hyphens: auto; + line-height: 1.4; + margin: 0; + -moz-hyphens: auto; + -ms-word-break: break-all; + width: 100% !important; + -webkit-hyphens: auto; + -webkit-text-size-adjust: none; + word-break: break-all; + word-break: break-word; +} + +p, +ul, +ol, +blockquote { + line-height: 1.4; + text-align: left; +} + +a { + color: #3869D4; +} + +a img { + border: none; +} + +/* Typography */ + +h1 { + color: #2F3133; + font-size: 19px; + font-weight: bold; + margin-top: 0; + text-align: left; +} + +h2 { + color: #2F3133; + font-size: 16px; + font-weight: bold; + margin-top: 0; + text-align: left; +} + +h3 { + color: #2F3133; + font-size: 14px; + font-weight: bold; + margin-top: 0; + text-align: left; +} + +p { + color: #74787E; + font-size: 16px; + line-height: 1.5em; + margin-top: 0; + text-align: left; +} + +p.sub { + font-size: 12px; +} + +img { + max-width: 100%; +} + +/* Layout */ + +.wrapper { + background-color: #f5f8fa; + margin: 0; + padding: 0; + width: 100%; + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; +} + +.content { + margin: 0; + padding: 0; + width: 100%; + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; +} + +/* Header */ + +.header { + padding: 25px 0; + text-align: center; +} + +.header a { + color: #bbbfc3; + font-size: 19px; + font-weight: bold; + text-decoration: none; + text-shadow: 0 1px 0 white; +} + +/* Body */ + +.body { + background-color: #FFFFFF; + border-bottom: 1px solid #EDEFF2; + border-top: 1px solid #EDEFF2; + margin: 0; + padding: 0; + width: 100%; + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; +} + +.inner-body { + background-color: #FFFFFF; + margin: 0 auto; + padding: 0; + width: 570px; + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 570px; +} + +/* Subcopy */ + +.subcopy { + border-top: 1px solid #EDEFF2; + margin-top: 25px; + padding-top: 25px; +} + +.subcopy p { + font-size: 12px; +} + +/* Footer */ + +.footer { + margin: 0 auto; + padding: 0; + text-align: center; + width: 570px; + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 570px; +} + +.footer p { + color: #AEAEAE; + font-size: 12px; + text-align: center; +} + +/* Tables */ + +.table table { + margin: 30px auto; + width: 100%; + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; +} + +.table th { + border-bottom: 1px solid #EDEFF2; + padding-bottom: 8px; +} + +.table td { + color: #74787E; + font-size: 15px; + line-height: 18px; + padding: 10px 0; +} + +.content-cell { + padding: 35px; +} + +/* Buttons */ + +.action { + margin: 30px auto; + padding: 0; + text-align: center; + width: 100%; + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; +} + +.button { + border-radius: 3px; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.16); + color: #FFF; + display: inline-block; + text-decoration: none; + -webkit-text-size-adjust: none; +} + +.button-blue { + background-color: #3097D1; + border-top: 10px solid #3097D1; + border-right: 18px solid #3097D1; + border-bottom: 10px solid #3097D1; + border-left: 18px solid #3097D1; +} + +.button-green { + background-color: #2ab27b; + border-top: 10px solid #2ab27b; + border-right: 18px solid #2ab27b; + border-bottom: 10px solid #2ab27b; + border-left: 18px solid #2ab27b; +} + +.button-red { + background-color: #bf5329; + border-top: 10px solid #bf5329; + border-right: 18px solid #bf5329; + border-bottom: 10px solid #bf5329; + border-left: 18px solid #bf5329; +} + +/* Panels */ + +.panel { + margin: 0 0 21px; +} + +.panel-content { + background-color: #EDEFF2; + padding: 16px; +} + +.panel-item { + padding: 0; +} + +.panel-item p:last-of-type { + margin-bottom: 0; + padding-bottom: 0; +} + +/* Promotions */ + +.promotion { + background-color: #FFFFFF; + border: 2px dashed #9BA2AB; + margin: 0; + margin-bottom: 25px; + margin-top: 25px; + padding: 24px; + width: 100%; + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; +} + +.promotion h1 { + text-align: center; +} + +.promotion p { + font-size: 15px; + text-align: center; +} diff --git a/resources/views/vendor/mail/markdown/button.blade.php b/resources/views/vendor/mail/markdown/button.blade.php new file mode 100644 index 0000000000..97444ebdcf --- /dev/null +++ b/resources/views/vendor/mail/markdown/button.blade.php @@ -0,0 +1 @@ +{{ $slot }}: {{ $url }} diff --git a/resources/views/vendor/mail/markdown/footer.blade.php b/resources/views/vendor/mail/markdown/footer.blade.php new file mode 100644 index 0000000000..bbcc5f635c --- /dev/null +++ b/resources/views/vendor/mail/markdown/footer.blade.php @@ -0,0 +1,5 @@ +@if ($show_url_in_emails=='1') +[{{ $slot }}]({{ $url }}) +@else +{{ $slot }} +@endif diff --git a/resources/views/vendor/mail/markdown/header.blade.php b/resources/views/vendor/mail/markdown/header.blade.php new file mode 100644 index 0000000000..99e2b4a1dc --- /dev/null +++ b/resources/views/vendor/mail/markdown/header.blade.php @@ -0,0 +1,6 @@ +@if ($show_url_in_emails=='1') +[{{ $slot }}]({{ $url }}) +@else +{{ $slot }} +@endif + diff --git a/resources/views/vendor/mail/markdown/layout.blade.php b/resources/views/vendor/mail/markdown/layout.blade.php new file mode 100644 index 0000000000..9378baa077 --- /dev/null +++ b/resources/views/vendor/mail/markdown/layout.blade.php @@ -0,0 +1,9 @@ +{!! strip_tags($header) !!} + +{!! strip_tags($slot) !!} +@isset($subcopy) + +{!! strip_tags($subcopy) !!} +@endisset + +{!! strip_tags($footer) !!} diff --git a/resources/views/vendor/mail/markdown/message.blade.php b/resources/views/vendor/mail/markdown/message.blade.php new file mode 100644 index 0000000000..b409c71cb6 --- /dev/null +++ b/resources/views/vendor/mail/markdown/message.blade.php @@ -0,0 +1,27 @@ +@component('mail::layout') + {{-- Header --}} + @slot('header') + @component('mail::header', ['url' => config('app.url')]) + {{ config('app.name') }} + @endcomponent + @endslot + + {{-- Body --}} + {{ $slot }} + + {{-- Subcopy --}} + @isset($subcopy) + @slot('subcopy') + @component('mail::subcopy') + {{ $subcopy }} + @endcomponent + @endslot + @endisset + + {{-- Footer --}} + @slot('footer') + @component('mail::footer') + © {{ date('Y') }} {{ config('app.name') }}. All rights reserved. + @endcomponent + @endslot +@endcomponent diff --git a/resources/views/vendor/mail/markdown/panel.blade.php b/resources/views/vendor/mail/markdown/panel.blade.php new file mode 100644 index 0000000000..3338f620e4 --- /dev/null +++ b/resources/views/vendor/mail/markdown/panel.blade.php @@ -0,0 +1 @@ +{{ $slot }} diff --git a/resources/views/vendor/mail/markdown/promotion.blade.php b/resources/views/vendor/mail/markdown/promotion.blade.php new file mode 100644 index 0000000000..3338f620e4 --- /dev/null +++ b/resources/views/vendor/mail/markdown/promotion.blade.php @@ -0,0 +1 @@ +{{ $slot }} diff --git a/resources/views/vendor/mail/markdown/promotion/button.blade.php b/resources/views/vendor/mail/markdown/promotion/button.blade.php new file mode 100644 index 0000000000..aaa3e57544 --- /dev/null +++ b/resources/views/vendor/mail/markdown/promotion/button.blade.php @@ -0,0 +1 @@ +[{{ $slot }}]({{ $url }}) diff --git a/resources/views/vendor/mail/markdown/subcopy.blade.php b/resources/views/vendor/mail/markdown/subcopy.blade.php new file mode 100644 index 0000000000..3338f620e4 --- /dev/null +++ b/resources/views/vendor/mail/markdown/subcopy.blade.php @@ -0,0 +1 @@ +{{ $slot }} diff --git a/resources/views/vendor/mail/markdown/table.blade.php b/resources/views/vendor/mail/markdown/table.blade.php new file mode 100644 index 0000000000..3338f620e4 --- /dev/null +++ b/resources/views/vendor/mail/markdown/table.blade.php @@ -0,0 +1 @@ +{{ $slot }} From 189574377a8635f9f998c8a9a9c4813bbb76f5d3 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Fri, 20 Oct 2017 16:58:39 -0700 Subject: [PATCH 4/6] Add 'where' clause to hasManyThrough relationship. (#4276) --- app/Models/Location.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Location.php b/app/Models/Location.php index 37348bd4a8..c524c1eb30 100755 --- a/app/Models/Location.php +++ b/app/Models/Location.php @@ -54,7 +54,7 @@ class Location extends SnipeModel public function assets() { - return $this->hasManyThrough('\App\Models\Asset', '\App\Models\User', 'location_id', 'assigned_to', 'id'); + return $this->hasManyThrough('\App\Models\Asset', '\App\Models\User', 'location_id', 'assigned_to', 'id')->where("assets.assigned_type",User::class); } public function locationAssets() From 25d3d668803822b31c136b0333e7f10919ce7da8 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Fri, 20 Oct 2017 17:17:11 -0700 Subject: [PATCH 5/6] Add performance-improving indexes (#4278) --- ..._234129_add_location_indices_to_assets.php | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 database/migrations/2017_10_20_234129_add_location_indices_to_assets.php diff --git a/database/migrations/2017_10_20_234129_add_location_indices_to_assets.php b/database/migrations/2017_10_20_234129_add_location_indices_to_assets.php new file mode 100644 index 0000000000..eb36933f6a --- /dev/null +++ b/database/migrations/2017_10_20_234129_add_location_indices_to_assets.php @@ -0,0 +1,35 @@ +index('rtd_location_id'); + $table->index(['assigned_type','assigned_to']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('assets', function (Blueprint $table) { + // + $table->dropIndex(['rtd_location_id']); + $table->dropIndex(['assigned_type','assigned_to']); + }); + } +} From 8ac57d0121ed84cac1d4fc5cab47a89d9dfa7dbc Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Fri, 20 Oct 2017 17:37:46 -0700 Subject: [PATCH 6/6] Need to prefix status_id with `assets.` for uniqueness (#4279) --- app/Http/Controllers/Api/AssetsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index 6b005c2bc8..180a51f7ae 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -98,7 +98,7 @@ class AssetsController extends Controller // These are used by the API to query against specific ID numbers if ($request->has('status_id')) { - $assets->where('status_id', '=', $request->input('status_id')); + $assets->where('assets.status_id', '=', $request->input('status_id')); } if ($request->has('model_id')) {