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 directorytable: Database table namerequire_force_in_production: Require --force flag in productionenable_rollback: Enable/disable rollback functionality
Maintainer
Roshan Poojary (GitHub: @sthira-labs)
License
MIT
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-25