Skip to content

Commit 5ecad66

Browse files
authored
Merge pull request #4852 from Laravel-Backpack/use-temporary-for-disk-in-column
use temporary disk in column too
2 parents fcd41b7 + 3bd9367 commit 5ecad66

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/resources/views/crud/columns/upload_multiple.blade.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66
$column['escaped'] = $column['escaped'] ?? true;
77
$column['wrapper']['element'] = $column['wrapper']['element'] ?? 'a';
88
$column['wrapper']['target'] = $column['wrapper']['target'] ?? '_blank';
9-
$column_wrapper_href = $column['wrapper']['href'] ?? function($file_path, $disk, $prefix) { return ( !is_null($disk) ?asset(\Storage::disk($disk)->url($file_path)):asset($prefix.$file_path) ); };
9+
$column_wrapper_href = $column['wrapper']['href'] ?? function($file_path, $disk, $prefix) { return
10+
!is_null($disk) ?
11+
(isset($column['temporary']) ?
12+
asset(\Storage::disk($disk)->temporaryUrl($file_path, Carbon\Carbon::now()->addMinutes($column['temporary']))) :
13+
asset(\Storage::disk($disk)->url($file_path))
14+
) : asset($prefix.$file_path));
15+
};
1016
1117
if($column['value'] instanceof \Closure) {
1218
$column['value'] = $column['value']($entry);

0 commit comments

Comments
 (0)