File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed
Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -40,26 +40,21 @@ protected function url(): Attribute
4040 {
4141 return Attribute::make (
4242 get: function () {
43- if (! config ('curator.should_check_exists ' , true )) {
44- return Storage::disk ($ this ->disk )->url ($ this ->path );
45- }
46-
47- if (Storage::disk ($ this ->disk )->exists ($ this ->path ) === false ) {
43+ if (config ('curator.should_check_exists ' , true ) && Storage::disk ($ this ->disk )->exists ($ this ->path ) === false ) {
4844 return '' ;
4945 }
5046
5147 try {
52- $ isPrivate = Storage::disk ($ this ->disk )->getVisibility ($ this ->path ) === 'private ' ;
48+ $ isPrivate = config ( ' curator.visibility ' , ' public ' ) === ' private ' || Storage::disk ($ this ->disk )->getVisibility ($ this ->path ) === 'private ' ;
5349 } catch (\Throwable ) {
5450 // ACL not supported on Storage Bucket, Laravel only throws exception here so need to be careful.
55- // so we assume it's private
56- $ isPrivate = config (sprintf ('filesystems.disks.%s.visibility ' , $ this ->disk )) !== 'public ' ;
51+ // so we assume it's private $isPrivate = config(sprintf('filesystems.disks.%s.visibility', $this->disk)) !== 'public';
5752 }
5853
59- return $ isPrivate ? Storage::disk ($ this ->disk )->temporaryUrl (
60- $ this ->path ,
61- now ()->addMinutes (5 )
62- ) : Storage::disk ($ this ->disk )->url ($ this ->path );
54+ return $ isPrivate ? Storage::disk ($ this ->disk )->temporaryUrl (
55+ $ this ->path ,
56+ now ()->addMinutes (5 )
57+ ) : Storage::disk ($ this ->disk )->url ($ this ->path );
6358 },
6459 );
6560 }
You can’t perform that action at this time.
0 commit comments