PHPackages                             brainstud/laravel-deployment-scripts - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. brainstud/laravel-deployment-scripts

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

brainstud/laravel-deployment-scripts
====================================

Create one time deployment scripts to run at the next release

v2.0.0(4mo ago)110.6k↓51.5%2MITPHPPHP ^8.5

Since Jan 6Pushed 4mo agoCompare

[ Source](https://github.com/brainstudnl/laravel-deployment-scripts)[ Packagist](https://packagist.org/packages/brainstud/laravel-deployment-scripts)[ Docs](https://github.com/brainstud/laravel-deployment-scripts)[ RSS](/packages/brainstud-laravel-deployment-scripts/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (20)Versions (10)Used By (0)

Introduction
------------

[](#introduction)

When deploying new code you'll sometimes need to execute one time scripts, commands or queries to activate new functionalities. With a growing application, it is easy to lose sight of which things should be executed for a given deployment. Laravel already has migrations which run after executing the artisan migrate command, but these migrations are aimed at database operations only.

The Laravel one time deployment scripts package aims to solve this problem by offering a migration-like way of registering scripts, commands and queries that should be executed. By simply registering the deployment scripts execute command, the package will check whether there are any scripts that should be executed. Once a script has been executed it will be registered in the database so that it won't run again.

Example
-------

[](#example)

The code snippet below is an example of how the deployment script is configured. A regular or an anonymous class is created which extends the DeploymentScript base class. Then it registers the up and down methods to contain the deployment tasks that need to be executed, and finally within those methods the desired tasks are executed.

```
return new class extends DeploymentScript {
	public function up()
	{
		$this->command('mycommand:trigger');

		$this->query('UPDATE `table` SET `foo` = 1 WHERE `baz` IS NULL');
	}

	public function down()
	{
		$this->closure(function () {
			(new CustomActionClass())->execute();
		});
	}
}
```

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

[](#installation)

You can install the package via composer:

```
composer require brainstud/laravel-deployment-scripts
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="deployment-scripts-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="deployment-scripts-config"
```

This is the content of the published config file:

```
return [
    'table_name' => 'deployment_scripts_log',
];
```

Usage
-----

[](#usage)

### Available commands

[](#available-commands)

CommandDescriptiondeployment-script:make {name}Create a new deployment script classdeployment-script:executeExecute the deployment scriptsdeployment-script:rollbackRoll back the deployment scripts by one iterationTesting
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

License
-------

[](#license)

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

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance77

Regular maintenance activity

Popularity28

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 60% 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 ~312 days

Recently: every ~376 days

Total

6

Last Release

124d ago

Major Versions

v1.0.4 → v2.0.02026-04-16

PHP version history (4 changes)v1.0.0PHP ^8.0

v1.0.2PHP ^8.1

v1.0.3PHP ^8.2

v2.0.0PHP ^8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/59a4113e79a9d7d16cf8857d4f256eabf9cd2a546b692a9ffb02b2ab86799567?d=identicon)[Diondb](/maintainers/Diondb)

![](https://www.gravatar.com/avatar/dcdd9cd8db3f43b6b6c140ff30840863339e17180bd3ea6745c9b151136610d7?d=identicon)[brdv](/maintainers/brdv)

---

Top Contributors

[![brdv](https://avatars.githubusercontent.com/u/44579145?v=4)](https://github.com/brdv "brdv (6 commits)")[![Diondb](https://avatars.githubusercontent.com/u/84917298?v=4)](https://github.com/Diondb "Diondb (4 commits)")

---

Tags

deploymentlaravellaravelbrainstudlaravel-deployment-scripts

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/brainstud-laravel-deployment-scripts/health.svg)

```
[![Health](https://phpackages.com/badges/brainstud-laravel-deployment-scripts/health.svg)](https://phpackages.com/packages/brainstud-laravel-deployment-scripts)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

13.0k107.5M1.6k](/packages/spatie-laravel-permission)[spatie/laravel-health

Monitor the health of a Laravel application

88212.7M188](/packages/spatie-laravel-health)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5226.7k](/packages/simplestats-io-laravel-client)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3915.5k](/packages/rawilk-profile-filament-plugin)[masterix21/laravel-licensing

Laravel licensing package with polymorphic assignment to any model, activation keys, expirations/renewals, and seat control via LicenseUsage. Supports offline verification with public-key–signed tokens, a CLI to generate/rotate/revoke keys, and an extensible architecture via config and contracts.

1614.1k4](/packages/masterix21-laravel-licensing)

PHPackages © 2026

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