Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with scoped driver #298

Closed
GeoSot opened this issue Dec 9, 2022 · 0 comments · Fixed by #300
Closed

Issue with scoped driver #298

GeoSot opened this issue Dec 9, 2022 · 0 comments · Fixed by #300

Comments

@GeoSot
Copy link
Contributor

GeoSot commented Dec 9, 2022

After setting up a media driver, given the 'scoped' option laravel/framework#44105, I am getting the following Exception

image
image

the issue seems to be \Plank\Mediable\UrlGenerators\UrlGeneratorFactory::getDriverForDisk, as it tries to parse the scoped driver

   protected function getDriverForDisk(string $disk): string
    {
        return (string) config("filesystems.disks.{$disk}.driver");
    }

I suppose, a change like this, will do the job

    protected function getDriverForDisk(string $disk): string
    {
        $getDriver= fn(string $disk)=> (string) config("filesystems.disks.{$disk}.driver");
        $driver = $getDriver($disk);

        return $driver === 'scoped' ? $getDriver($driver['disk']) : $driver;
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant