mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-12 16:44:08 -08:00
Updated asset counters
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
2888dd6fd8
commit
dfaf01e8aa
|
@ -5,6 +5,7 @@ namespace App\Http\Middleware;
|
||||||
use App\Models\Asset;
|
use App\Models\Asset;
|
||||||
use Auth;
|
use Auth;
|
||||||
use Closure;
|
use Closure;
|
||||||
|
use App\Models\Setting;
|
||||||
|
|
||||||
class AssetCountForSidebar
|
class AssetCountForSidebar
|
||||||
{
|
{
|
||||||
|
@ -24,6 +25,13 @@ class AssetCountForSidebar
|
||||||
\Log::debug($e);
|
\Log::debug($e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$total_assets = Asset::RTD()->count();
|
||||||
|
view()->share('total_assets', $total_assets);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
\Log::debug($e);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$total_deployed_sidebar = Asset::Deployed()->count();
|
$total_deployed_sidebar = Asset::Deployed()->count();
|
||||||
view()->share('total_deployed_sidebar', $total_deployed_sidebar);
|
view()->share('total_deployed_sidebar', $total_deployed_sidebar);
|
||||||
|
@ -59,6 +67,27 @@ class AssetCountForSidebar
|
||||||
\Log::debug($e);
|
\Log::debug($e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$settings = Setting::getSettings();
|
||||||
|
view()->share('settings', $settings);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
\Log::debug($e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$total_due_for_audit = Asset::DueForAudit($settings)->count();
|
||||||
|
view()->share('total_due_for_audit', $total_due_for_audit);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
\Log::debug($e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$total_overdue_for_audit = Asset::OverdueForAudit($settings)->count();
|
||||||
|
view()->share('total_overdue_for_audit', $total_overdue_for_audit);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
\Log::debug($e);
|
||||||
|
}
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue