diff --git a/app/Models/DashboardModel.php b/app/Models/DashboardModel.php index 2392c3e..1338fb5 100644 --- a/app/Models/DashboardModel.php +++ b/app/Models/DashboardModel.php @@ -168,4 +168,13 @@ class DashboardModel extends Model return $user_check; } + + /** + * Returns the Unix timestamp of the latest update + * + * @return number + */ + public function timestamp() { + return strtotime($this->updated_at); + } } diff --git a/resources/views/dashboard/edit-item.blade.php b/resources/views/dashboard/edit-item.blade.php index 5ba554b..53d2091 100644 --- a/resources/views/dashboard/edit-item.blade.php +++ b/resources/views/dashboard/edit-item.blade.php @@ -53,7 +53,7 @@ @if(file_exists(base_path() . '/public' . $current_image))
- + @if(array_key_exists('delete', $column) && $column['delete']) @@ -63,13 +63,12 @@
@endif @elseif($column['type'] == 'file') - - @set('current_file', "/uploads/$model/files/$id-" . $column['name'] . '.' . $column['ext']) + @if(file_exists(base_path() . '/public' . $current_file))
- View {{ strtoupper($column['ext']) }} + View {{ strtoupper($column['ext']) }} @if(array_key_exists('delete', $column) && $column['delete'])