Closed Wulfheart closed 2 weeks ago
Heya, thanks for reporting.
If you notice improper DocBlock, PHPStan, or IDE warnings while using Laravel, do not create a GitHub issue. Instead, please submit a pull request to fix the problem. Also see our contribution guide.
Thanks!
Hey Dries, I don’t know how to fix this.
Laravel Version
v11.21.0
PHP Version
8.3.10
Database Driver & Version
No response
Description
When using
Storage::disk('local')->u
the->url('...')
method is not displayed in IDE autocompletion because it doesn't exist in the return type ofStorage::disk()
.Steps To Reproduce
https://github.com/laravel/framework/blob/b9cf7d3217732e9a0fa4f00e996b3f9cc5bf7abd/src/Illuminate/Support/Facades/Storage.php#L9 According to the docblocks in
Illuminate\Support\Facades\Storage
the disk method returns an instance ofIlluminate\Filesystem\Filesystem
. However, inphp artisan tinker
Storage::disk('local')
returnsIlluminate\Filesystem\FilesystemAdapter
which has the url method. Unfortunately this is not reflected in the IDE.