diff --git a/app/models/Asset.php b/app/models/Asset.php index 58f3af8a35..685fc2f4a6 100644 --- a/app/models/Asset.php +++ b/app/models/Asset.php @@ -74,6 +74,22 @@ class Asset extends Elegant { return $this->belongsTo('User','id'); } + /** + * Get total assets + */ + public static function assetcount() + { + return Asset::where('physical', '==', 1)->count(); + } + + /** + * Get total assets not checked out + */ + public static function availassetcount() + { + return Asset::where('assigned_to', '==', 0)->count(); + } + } diff --git a/app/models/License.php b/app/models/License.php index ca8f60ee9b..f615c7bd2a 100644 --- a/app/models/License.php +++ b/app/models/License.php @@ -45,5 +45,22 @@ class License extends Elegant { return $this->belongsTo('User','id'); } + /** + * Get total licenses + */ + public static function assetcount() + { + return Asset::where('physical', '==', 1)->count(); + } + + /** + * Get total licenses not checked out + */ + public static function availassetcount() + { + return Asset::where('assigned_to', '==', 0)->count(); + } + + } diff --git a/app/views/backend/layouts/default.blade.php b/app/views/backend/layouts/default.blade.php index c81aecaa4f..b93797707f 100755 --- a/app/views/backend/layouts/default.blade.php +++ b/app/views/backend/layouts/default.blade.php @@ -116,7 +116,11 @@ Admin