E5F5 fix visibility in cloud storage · trdynet/laravel-filemanager@fcd7174 · GitHub
[go: up one dir, main page]

Skip to content

Commit fcd7174

Browse files
committed
fix visibility in cloud storage
1 parent 6579521 commit fcd7174

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

src/LfmFileRepository.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ public function rootPath()
2525
return public_path() . '/';
2626
}
2727

28+
public function url($path)
29+
{
30+
return '/' . $path;
31+
}
32+
2833
public function isDirectory()
2934
{
3035
$parent_path = substr($this->path, 0, strrpos($this->path, '/'));

src/LfmPath.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function translateToOsPath($path)
8585

8686
public function url()
8787
{
88-
return Lfm::DS . $this->path('url');
88+
return $this->storage->url($this->path('url'));
8989
}
9090

9191
public function folders()
@@ -139,7 +139,7 @@ public function createFolder()
139139
return false;
140140
}
141141

142-
return $this->storage->makeDirectory(0777, true, true);
142+
$this->storage->makeDirectory(0777, true, true);
143143
}
144144

145145
/**

src/LfmStorageRepository.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,16 @@ public function save($file, $new_filename)
4646
{
4747
$this->disk->putFileAs($this->path, $file, $new_filename);
4848
}
49+
50+
public function url($path)
51+
{
52+
return $this->disk->url($path);
53+
}
54+
55+
public function makeDirectory($mode, $recursive, $force)
56+
{
57+
$this->disk->makeDirectory($this->path, $mode, $recursive, $force);
58+
59+
$this->disk->setVisibility($this->path, 'public');
60+
}
4961
}

0 commit comments

Comments
 (0)
0