sthira-labs/laravel-deployments

A simple, migration-like deployment script manager for Laravel applications.

Maintainers

Package info

github.com/sthira-labs/laravel-deployments

pkg:composer/sthira-labs/laravel-deployments

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2025-12-25 19:13 UTC

This package is auto-updated.

Last update: 2026-02-25 19:43:55 UTC


README

A simple, migration-like deployment script manager for Laravel applications.

Installation

composer require sthira-labs/laravel-deployments

Setup

Publish the configuration and migration:

php artisan vendor:publish --tag=deployments-config
php artisan vendor:publish --tag=deployments-migrations
php artisan vendor:publish --tag=deployments-stubs

Run the migration:

php artisan migrate

Usage

Create a Deployment

php artisan make:deployment PatAutomation

This creates a timestamped file in app/Deployments/.

Run Deployments

# Dry run (no DB writes)
php artisan deploy:run --dry

# Execute deployments
php artisan deploy:run

# Production (requires --force)
php artisan deploy:run --force

Check Status

php artisan deploy:status

Rollback

# Rollback last batch
php artisan deploy:rollback

# Rollback specific batch
php artisan deploy:rollback --batch=1

# Production rollback
php artisan deploy:rollback --force

Example Deployment

<?php

namespace App\Deployments;

use SthiraLabs\LaravelDeployments\Deployment;
use Illuminate\Support\Facades\DB;

class PatAutomation extends Deployment
{
    public function summary(): array
    {
        return [
            'Run User seeder',
            'Assign permissions to Admin role',
        ];
    }

    protected function handle(): void
    {
        $this->write(
            fn () => DB::table('users')->update(['active' => true]),
            'Activate all users'
        );
    }

    protected function rollback(): void
    {
        DB::table('users')->update(['active' => false]);
    }
}

Configuration

Edit config/deployments.php to customize:

  • path: Deployment scripts directory
  • table: Database table name
  • require_force_in_production: Require --force flag in production
  • enable_rollback: Enable/disable rollback functionality

Maintainer

Roshan Poojary (GitHub: @sthira-labs)

License

MIT