sthira-labs/laravel-deployments 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sthira-labs/laravel-deployments

最新稳定版本:v1.0.0

Composer 安装命令:

composer require sthira-labs/laravel-deployments

包简介

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

README 文档

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

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固