-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #154 from TheDragonCode/6.x
[6.x] Rename the project to “Deploy Operations” from “Deploy Actions”
- Loading branch information
Showing
124 changed files
with
2,151 additions
and
1,766 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
database/migrations/2024_05_21_112438_rename_actions_table_to_operations.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use DragonCode\LaravelDeployOperations\Helpers\Config; | ||
use DragonCode\LaravelDeployOperations\Operation; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Operation { | ||
public function up(): void | ||
{ | ||
if (Schema::hasTable('actions') && $this->doesntSame('actions', $this->table())) { | ||
$this->validateTable($this->table()); | ||
|
||
Schema::rename('actions', $this->table()); | ||
} | ||
} | ||
|
||
public function down(): void | ||
{ | ||
if (Schema::hasTable($this->table()) && $this->doesntSame('actions', $this->table())) { | ||
$this->validateTable('actions'); | ||
|
||
Schema::rename($this->table(), 'actions'); | ||
} | ||
} | ||
|
||
protected function validateTable(string $name): void | ||
{ | ||
if (Schema::hasTable($name)) { | ||
throw new RuntimeException(sprintf('A table named [%s] already exists. Change the table name settings in the [%s] configuration file.', $name, 'config/deploy-operations.php')); | ||
} | ||
} | ||
|
||
protected function doesntSame(string $first, string $second): bool | ||
{ | ||
return $first !== $second; | ||
} | ||
|
||
protected function table(): string | ||
{ | ||
return app(Config::class)->table(); | ||
} | ||
}; |
32 changes: 32 additions & 0 deletions
32
database/migrations/2024_05_21_114318_rename_column_in_operations_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use DragonCode\LaravelDeployOperations\Helpers\Config; | ||
use DragonCode\LaravelDeployOperations\Operation; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Operation { | ||
public function up(): void | ||
{ | ||
$this->rename('action', 'operation'); | ||
} | ||
|
||
public function down(): void | ||
{ | ||
$this->rename('operation', 'action'); | ||
} | ||
|
||
protected function rename(string $from, string $to): void | ||
{ | ||
if (Schema::hasColumn($this->table(), $from)) { | ||
Schema::table($this->table(), fn (Blueprint $table) => $table->renameColumn($from, $to)); | ||
} | ||
} | ||
|
||
protected function table(): string | ||
{ | ||
return app(Config::class)->table(); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
# Installation | ||
|
||
To get the latest version of `Deploy Actions for Laravel`, simply require the project using [Composer](https://getcomposer.org): | ||
To get the latest version of `Deploy Operations for Laravel`, require the project using [Composer](https://getcomposer.org): | ||
|
||
```bash | ||
composer require dragon-code/laravel-actions | ||
composer require dragon-code/laravel-deploy-operations | ||
``` | ||
|
||
Or manually update `require` block of `composer.json` and run `composer update` console command. | ||
|
||
```json | ||
{ | ||
"require": { | ||
"dragon-code/laravel-actions": "^5.0" | ||
"dragon-code/laravel-deploy-operations": "^6.0" | ||
} | ||
} | ||
``` | ||
|
||
If necessary, you can publish the configuration file by calling the console command: | ||
|
||
```bash | ||
php artisan vendor:publish --provider="DragonCode\LaravelActions\ServiceProvider" | ||
php artisan vendor:publish --provider="DragonCode\LaravelDeployOperations\ServiceProvider" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.