Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Illuminate/Contracts/Filesystem/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Illuminate\Contracts\Filesystem;

use Illuminate\Filesystem\StoragePath;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/**
* @method \Illuminate\Filesystem\StoragePath at(string $path)
*/

Use docblock instead adding breaking change method in a minor release.

interface Filesystem
{
/**
Expand Down Expand Up @@ -217,4 +219,9 @@ public function makeDirectory($path);
* @return bool
*/
public function deleteDirectory($directory);

/**
* Get a storage path instance for the given path.
*/
public function at(string $path): StoragePath;
}
8 changes: 8 additions & 0 deletions src/Illuminate/Filesystem/FilesystemAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,14 @@ protected function shouldReport(): bool
return (bool) ($this->config['report'] ?? false);
}

/**
* Get a storage path instance for the given path.
*/
public function at(string $path): StoragePath
{
return new StoragePath($path, $this);
}

/**
* Pass dynamic methods call onto Flysystem.
*
Expand Down
8 changes: 8 additions & 0 deletions src/Illuminate/Filesystem/FilesystemManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ public function cloud()
return $this->disks[$name] = $this->get($name);
}

/**
* Get a storage path instance for the default disk.
*/
public function at(string $path): StoragePath
{
return $this->disk()->at($path);
}

/**
* Build an on-demand disk.
*
Expand Down
Loading
Loading