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

Create paths automatically when not exists #104

Closed
estudioprogramacaocriativa opened this issue Sep 2, 2023 · 2 comments
Closed

Create paths automatically when not exists #104

estudioprogramacaocriativa opened this issue Sep 2, 2023 · 2 comments

Comments

@estudioprogramacaocriativa

I'd just finish installation of the Folio package to try it out on an existing project. After do some configurations I get this error:
Screenshot 2023-09-02 at 13 15 07

My suggestion is to create the path instead of throws an error

public function registerRoute(string $path, string $uri, array $middleware, ?string $domain): void
    {
        $absolutePath = $path;
        $path = realpath($absolutePath);
        $uri = '/'.ltrim($uri, '/');


        if (! is_dir($path)) {
            mkdir($absolutePath, 0777, true);
        }

        $this->mountPaths[] = $mountPath = new MountPath(
            $path,
            $uri,
            $middleware,
            $domain,
        );

        Route::fallback($this->handler())->name('laravel-folio');
    }
@crynobone
Copy link
Member

This is automatically done for the default path. You should create the folder if you wish to change the location:
https://github.com/laravel/folio/blob/master/src/Console/InstallCommand.php#L45-L52

@estudioprogramacaocriativa
Copy link
Author

Hi @crynobone. I understand but, as we can define our default directories in Folio Provider does not make sense that defined directories there are automatically created too?

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

No branches or pull requests

2 participants