tshevchenko/installer

installer for laravel packages

Installs: 8

Dependents: 3

Suggesters: 0

Security: 0

Stars: 0

Forks: 0

Type:composer-plugin

v1.0 2024-04-28 14:04 UTC

This package is not auto-updated.

Last update: 2024-05-12 13:17:53 UTC


README

Package to handle custom composer installer actions

Installation

composer require tshevchenko/installer

add functions to the root composer.json scripts

     "scripts": {
         "post-autoload-dump": [
             "Tshevchenko\\Installer\\Installer::postAutoloadDump"
         ],
         "post-package-install": [
             "Tshevchenko\\Installer\\Installer::postInstallEvent"
         ],
         "pre-package-uninstall": [
             "Tshevchenko\\Installer\\Installer::preUninstallEvent"
         ]
     }

Using in the packages

package type="tshevchenko-package"

add needed actions to the package composer.json extra

    "extra": {
        "Tshevchenko\\Installer\\Installer::postInstallEvent": {
            "callArtisan": [
                [
                    "migrate",
                    "test-command:test testOption",
                    "vendor:publish --tag=public --force"
                ]
            ]
        },
        "Tshevchenko\\Installer\\Installer::preUninstallEvent": {
            "callArtisan": [
                [
                    "migrate:rollback"
                ]
            ]
        }
    }