Skip to content

php artisan vendor:publish --provider= is broken #55339

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

Closed
Harrald opened this issue Apr 9, 2025 · 6 comments
Closed

php artisan vendor:publish --provider= is broken #55339

Harrald opened this issue Apr 9, 2025 · 6 comments

Comments

@Harrald
Copy link

Harrald commented Apr 9, 2025

Laravel Version

12.8.1

PHP Version

8.3

Database Driver & Version

No response

Description

When running php artisan vendor:publish --provider=With\A\Valid\Provider
It gives the message: INFO No publishable resources for tag [].

However. when running php artisan vendor:publish and then select the same serviceprovider. It works just fine.

Steps To Reproduce

When running php artisan vendor:publish --provider=With\A\Valid\Provider
It gives the message: INFO No publishable resources for tag [].

However. when running php artisan vendor:publish and then select the same serviceprovider. It works just fine.

@Rayiumir
Copy link

@Harrald

This problem occurs when you do not define the package path in bootstrap/providers.php.
Did you define the package path?

@Harrald
Copy link
Author

Harrald commented Apr 10, 2025

@Harrald

This problem occurs when you do not define the package path in bootstrap/providers.php. Did you define the package path?

I do not have it there, however the package has it in its composer.json:

"extra": {
        "laravel": {
            "providers": [
                "With\\A\\Valid\\Provider"
            ]
        }
    },

@Rayiumir
Copy link

@Harrald
This problem occurs when you do not define the package path in bootstrap/providers.php. Did you define the package path?

I do not have it there, however the package has it in its composer.json:

"extra": {
        "laravel": {
            "providers": [
                "With\\A\\Valid\\Provider"
            ]
        }
    },

This composer.json is correct.

I mean, for Laravel to recognize your package, you need to define the ValidServiceProvider path in providers.php.

@crynobone
Copy link
Member

Hey there, thanks for reporting this issue.

We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?

Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.

laravel new bug-report --github="--public"

Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.

Thanks!

@devajmeireles
Copy link
Contributor

@crynobone I don't think this issue is related to Laravel, but to the terminal itself.

The output of this:

echo With\A\Valid\Provider

Will be:

WithAValidProvider

The correct thing to do is use one of this way:

php artisan vendor:publish --provider="With\A\Valid\Provider"

or

php artisan vendor:publish --provider=With\\A\\Valid\\Provider

Since I don't see --provider in the Laravel docs, I don't expect to have a PR to adapt the documentation with these examples.

@Harrald
Copy link
Author

Harrald commented Apr 15, 2025

I feel dumb 😅. Yes, that was totally the issue! Sorry for wasting your time!

edit: however, I do find the error misleading. i use the provider parameter, but i get a error message mentioning a tag that can not be found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants