Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

connecteev's avatar

Installing from a git repository: `php artisan vendor:publish ...` fails with "No publishable resources for tag"

I have an older version (v4) of Mailcoach, which is a spatie package for sending emails. My Mailcoach membership has expired, which leaves me with one option: I am forced to host mailcoach v4 in a private git repository, and install mailcoach into my laravel app by pointing to my own (private) mailcoach git repo.

I was finally able to install mailcoach from my own private git repository, using a config like this in composer.json file:

    "require": {
        "myusername/spatie-laravel-mailcoach": "^4.15.7",
     },
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "myusername/spatie-laravel-mailcoach",
                "version": "4.15.7",
                "source": {
                    "url": "https://github.com/myusername/spatie-laravel-mailcoach.git",
                    "type": "git",
                    "reference": "main"
                }
            }
        }
    ]

The next step is to run the php artisan vendor:publish command to publish the config file and prepare the DB by publishing migrations. Unfortunately, both commands below don't work and show a "No publishable resources for tag" message.

https://mailcoach.app/docs/self-hosted/v4/installation/in-an-existing-laravel-app#content-publish-the-config-file
$ php artisan vendor:publish --provider="Spatie\Mailcoach\MailcoachServiceProvider" --tag="mailcoach-config"
   INFO  No publishable resources for tag [mailcoach-config].  

https://mailcoach.app/docs/self-hosted/v4/installation/in-an-existing-laravel-app#content-prepare-the-database

$ php artisan vendor:publish --provider="Spatie\Mailcoach\MailcoachServiceProvider" --tag="mailcoach-migrations"
   INFO  No publishable resources for tag [mailcoach-migrations].

I suspect that this has something to do with the fact that I am using a private git repository like https://github.com/myusername/spatie-laravel-mailcoach.git and the command is not recognizing the namespace. What am I missing?

0 likes
5 replies
christian-qode's avatar

Can you double-check the package is installed by searching it in the vendor directory?

The namespace should be the same so the vendor:publish should work also in a private repository.

If it doesn't work, you can also copy the files from the vendor directory by yourself.

connecteev's avatar

Thank you.

The packages have been installed in the vendor directory. However the commands don’t work - this worries me and I would really like to get them working instead of copying the files manually. Any ideas?

Could it be a composer setting, Laravel config setting or something else?

aurawindsurfing's avatar

Does your composer autoload actually discover the package?

To me it looks like it does not have it registered.

connecteev's avatar
connecteev
OP
Best Answer
Level 11

@aurawindsurfing, you're right....it was not registered. Here are the complete steps of how I was able to get it working. Note: the repo's (https://github.com/myusername/spatie-laravel-mailcoach.git) branch should be called "main", not "dev-main" (this is important)

run:

laravel new mailcoach_testing

cd mailcoach_testing

rm composer.lock (this is important)

Change composer.json (of the project): (this is important)

"minimum-stability": "stable",

to

"minimum-stability": "dev",

run: composer require "spatie/laravel-mailcoach:dev-main"

Now, you can publish the config file. run:

php artisan vendor:publish --provider="Spatie\Mailcoach\MailcoachServiceProvider" --tag="mailcoach-config"

INFO  Publishing [mailcoach-config] assets.  
Copying file [vendor/spatie/laravel-mailcoach/config/mailcoach.php] to [config/mailcoach.php] ............................................... DONE
abdellahak's avatar

try this :

composer dump-autoload

then run the php artisan vendor:publish again

Please or to participate in this conversation.