From fb2428e21b4bd27720b7667cfe1fb103a143fc9f Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 16 Jan 2019 14:20:33 +0000 Subject: [PATCH] fixes #109 --- app/Item.php | 20 ++++++++++++++++++++ resources/views/item.blade.php | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/app/Item.php b/app/Item.php index 0c7f7778..69953e16 100644 --- a/app/Item.php +++ b/app/Item.php @@ -7,6 +7,7 @@ use Symfony\Component\ClassLoader\ClassMapGenerator; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\Builder; use App\User; +use App\Application; class Item extends Model { @@ -200,7 +201,26 @@ class Item extends Model return $config; } + public static function applicationDetails($class) + { + if(!empty($class)) { + $name = self::nameFromClass($class); + $application = Application::where('name', $name)->first(); + if($application) return $application; + } + return false; + + } + + public static function getApplicationDescription($class) + { + $details = self::applicationDetails($class); + if($details !== false) { + return $details->description.' - '.$details->license; + } + return ''; + } /** * Get the user that owns the item. diff --git a/resources/views/item.blade.php b/resources/views/item.blade.php index fb70cb75..c6b21582 100644 --- a/resources/views/item.blade.php +++ b/resources/views/item.blade.php @@ -11,7 +11,7 @@
@endif - link_target !!} href="{{ $app->link }}"> + link_target !!} href="{{ $app->link }}">