File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/resources/views/crud/columns Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 77 $column [' width' ] = $column [' width' ] ?? " auto" ;
88 $column [' radius' ] = $column [' radius' ] ?? " 3px" ;
99 $column [' prefix' ] = $column [' prefix' ] ?? ' ' ;
10+ $column [' temporary' ] = $column [' temporary' ] ?? false ;
11+ $column [' expire' ] = $column [' expire' ] ?? 1 ;
1012
1113 if ($column [' value' ] instanceof \ Closure ) {
1214 $column [' value' ] = $column [' value' ]($entry );
1921 if (preg_match ('/ ^ data\: image\/ /' , $column [' value' ])) { // base64_image
2022 $href = $src = $column [' value' ];
2123 } elseif (isset ($column [' disk' ])) { // image from a different disk (like s3 bucket)
22-
24+
2325 if (! empty ($column [' temporary' ])) {
24- $href = $src = Storage:: disk ($column [' disk' ])
25- -> temporaryUrl ($column [' prefix' ]. $column [' value' ], now ()-> addMinutes ((int ) $column [' temporary' ]));
26+ $href = $src = Storage:: disk ($column [' disk' ])-> temporaryUrl ($column [' prefix' ]. $column [' value' ], now ()-> addMinutes ((int ) $column [' expire' ]));
2627 } else {
2728 $href = $src = Storage:: disk ($column [' disk' ])-> url ($column [' prefix' ]. $column [' value' ]);
2829 }
29-
30+
3031 } else { // plain-old image, from a local disk
3132 $href = $src = asset ($column [' prefix' ] . $column [' value' ]);
3233 }
You can’t perform that action at this time.
0 commit comments