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

Fix stub path for non-Windows environments #1

Closed
jcandan opened this issue Dec 9, 2022 · 1 comment
Closed

Fix stub path for non-Windows environments #1

jcandan opened this issue Dec 9, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@jcandan
Copy link

jcandan commented Dec 9, 2022

Problem

The following exception occurs:

file_get_contents(/app/vendor/leandrocfe/filament-apex-charts/src/CommandsLine.stub): Failed to open stream: No such file or directory

Steps to reproduce

Within a Linux container, run php artisan make:filament-apex-charts BlogPostsChart.

Proposed resolution

It is my understanding that Windows supports forward slashes.

Update getStubPath to use forward slashes:

        $path = Str::of(__DIR__)
            ->replace('src/Commands', 'stubs/')

If this does not work on Windows, then this works too:

        $path = Str::of(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'stubs'.DIRECTORY_SEPARATOR)

Though, judging by FortifyServiceProvider.php, this seems like the way to go:

        $path = Str::of(__DIR__.'../../stubs/')
@leandrocfe leandrocfe added the bug Something isn't working label Dec 9, 2022
@leandrocfe
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants