diff --git a/resources/views/themes/zeus/addons/library-item.blade.php b/resources/views/themes/zeus/addons/library-item.blade.php index fe3ed24..713cf48 100644 --- a/resources/views/themes/zeus/addons/library-item.blade.php +++ b/resources/views/themes/zeus/addons/library-item.blade.php @@ -28,12 +28,12 @@

@if($item->type === 'IMAGE') - + @endif @if($item->type === 'FILE')
- + {{ __('Show File') }}
@@ -41,10 +41,9 @@ @if($item->type === 'VIDEO') @endif - diff --git a/src/Models/Library.php b/src/Models/Library.php index b828116..31b6a8e 100644 --- a/src/Models/Library.php +++ b/src/Models/Library.php @@ -47,4 +47,13 @@ public function getRouteKeyName() { return 'slug'; } + + public function theFile() + { + if (! $this->getMedia('library')->isEmpty()) { + return $this->getFirstMediaUrl('library'); + } + + return $this->file_path; + } }