PHPackages                             esign/laravel-install-command - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. esign/laravel-install-command

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

esign/laravel-install-command
=============================

Simplify stub publishing and effortlessly manage Composer and Node packages

2.0.0(2mo ago)01.8kMITPHPPHP ^8.1CI passing

Since Nov 21Pushed 2mo agoCompare

[ Source](https://github.com/esign/laravel-install-command)[ Packagist](https://packagist.org/packages/esign/laravel-install-command)[ Docs](https://github.com/esign/laravel-install-command)[ RSS](/packages/esign-laravel-install-command/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (21)Versions (10)Used By (0)

Simplify stub publishing and effortlessly manage Composer and Node packages
===========================================================================

[](#simplify-stub-publishing-and-effortlessly-manage-composer-and-node-packages)

[![Latest Version on Packagist](https://camo.githubusercontent.com/fc52026db117685a5bf80e350fa929aec13af231430c61c2bc132695a34cf9c1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f657369676e2f6c61726176656c2d696e7374616c6c2d636f6d6d616e642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/esign/laravel-install-command)[![Total Downloads](https://camo.githubusercontent.com/07cdc09a766c152bb6baedc4fde2a7eeb819e4d383292b3c5bfedf878b980816/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f657369676e2f6c61726176656c2d696e7374616c6c2d636f6d6d616e642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/esign/laravel-install-command)[![GitHub Actions](https://github.com/esign/laravel-install-command/actions/workflows/main.yml/badge.svg)](https://github.com/esign/laravel-install-command/actions/workflows/main.yml/badge.svg)

This package provides a simple way to publish stubs and install Composer and Node packages using a Laravel Command. This may be useful when creating packages that require stubs to be publish and require Composer and Node packages to be installed.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require esign/laravel-install-command
```

Usage
-----

[](#usage)

To make use of the InstallJob you may create a new command that extends the InstallCommand class. In this command you may specify the stubs to publish and the Composer and Node packages to install.

```
use Esign\InstallCommand\InstallCommand;
use Esign\InstallCommand\ValueObjects\AppendableFile;
use Esign\InstallCommand\ValueObjects\ComposerPackage;
use Esign\InstallCommand\ValueObjects\NodePackage;
use Esign\InstallCommand\ValueObjects\PublishableFile;
use Esign\InstallCommand\ValueObjects\PublishableFolder;

class MyInstallCommand extends InstallCommand
{
    protected $signature = 'my-install-command';
    protected $description = 'Publish my stubs and install my packages';

    protected function publishableFiles(): array
    {
        return [
            new PublishableFile(
                path: __DIR__ . '/../../stubs/my-stub.stub',
                target: base_path('my-stub.php'),
            ),
            new PublishableFolder(
                path: __DIR__ . '/../../stubs/resources',
                target: base_path('resources'),
            ),
            new AppendableFile(
                path: __DIR__ . '/../../stubs/my-appendable-stub.stub',
                target: base_path('my-appendable-stub.php'),
            ),
            new AppendableFile(
                path: __DIR__ . '/../../stubs/my-appendable-stub.stub',
                target: base_path('my-appendable-stub.php'),
                search: 'insert-after-line-with-this-string',
            ),
        ];
    }

    protected function composerPackages(): array
    {
        return [
            new ComposerPackage(name: 'my/composer-package'),
            new ComposerPackage(name: 'my/specific-composer-package', version: '^1.0'),
            new ComposerPackage(name: 'my/dev-composer-package', dev: true),
        ];
    }

    protected function nodePackages(): array
    {
        return [
            new NodePackage(name: 'my/node-package'),
            new NodePackage(name: 'my/specific-node-package', version: '^1.0'),
            new NodePackage(name: 'my/dev-node-package', dev: true),
        ];
    }
}
```

### Publishing behavior

[](#publishing-behavior)

By default, file publishing is conservative:

- `PublishableFile`: publishes the file only when the target file does not already exist.
- `PublishableFolder`: evaluates files inside the folder individually. Missing files are published, existing files are skipped.
- `AppendableFile`: appends content when the target file does not exist yet, or when the appendable content is not already present.

If you run the command with `--force`, the installer becomes aggressive:

- existing published files are overwritten
- existing files inside published folders are overwritten
- appendable content is appended again, even if it is already present

### Filtering files

[](#filtering-files)

You can pass `--filter` one or more times to publish only files whose target path contains any of the given strings (case-insensitive):

```
php artisan my-install-command --filter=Services
php artisan my-install-command --filter=Services --filter=Models
```

This is useful when you want to re-publish specific files without running the full install. Note that `--filter` only affects file publishing; Composer and Node package installation is unaffected.

### Publish overview

[](#publish-overview)

After publishing files, the command prints an overview of what happened:

```
📄 Publish overview: 3 published, 1 skipped.
Published files:
 + /path/to/source.stub -> /path/to/target.php
Skipped files:
 - /path/to/source.stub -> /path/to/target.php

```

This makes it easier to see which files were created, overwritten, appended, or skipped during installation.

### Testing

[](#testing)

```
composer test
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance86

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~177 days

Recently: every ~193 days

Total

6

Last Release

67d ago

Major Versions

1.4.0 → 2.0.02026-04-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/4599d7a8f6fdb63dd04305a49ae5ec9700b7a6eacdbe3a54f89584d75e34503f?d=identicon)[esign](/maintainers/esign)

---

Top Contributors

[![jordyvanderhaegen](https://avatars.githubusercontent.com/u/24370626?v=4)](https://github.com/jordyvanderhaegen "jordyvanderhaegen (37 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (3 commits)")

---

Tags

esigninstall-command

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/esign-laravel-install-command/health.svg)

```
[![Health](https://phpackages.com/badges/esign-laravel-install-command/health.svg)](https://phpackages.com/packages/esign-laravel-install-command)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

21332.6M1.6k](/packages/illuminate-queue)[illuminate/session

The Illuminate Session package.

9939.3M849](/packages/illuminate-session)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React/Svelte) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

4925.3k](/packages/erag-laravel-lang-sync-inertia)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
