Composer scripts

123 views Asked by At

I'm currently developing a package for Laravel 5. Now I wrote an artisan command and I want it to run every time a user installs the package (requires) or runs composer update.

So in my composer.json file of the package I have added the scripts section but for some reason It is not working. I tried a lot of different things and combinations, the one here is my latest version.

I hope somebody can help me out with this.

"scripts": {
    "post-install-cmd": [
        "php artisan blogify:create-dirs"
    ],
    "post-update-cmd": [
        "php artisan blogify:create-dirs"
    ]
}
1

There are 1 answers

1
Sven On BEST ANSWER

Composer only runs commands in the main composer.json file, not that of any package.

If you want to have the commands executed, they have to manually be added to the app that is using your package.