Skip to content

Commit

Permalink
Removed support for older versions of Laravel
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-helldar committed May 13, 2024
1 parent 2dd27c1 commit 63a29c3
Show file tree
Hide file tree
Showing 61 changed files with 176 additions and 524 deletions.
32 changes: 15 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,42 +39,40 @@
}
],
"require": {
"php": "^8.0.2",
"php": "^8.2",
"composer-runtime-api": "^2.2",
"doctrine/dbal": "^2.13 || ^3.4",
"dragon-code/laravel-support": "^3.5",
"dragon-code/simple-dto": "^2.5.1",
"dragon-code/support": "^6.6",
"illuminate/console": "^7.30.6 || ^8.75 || ^9.0 || ^10.0 || ^11.0",
"illuminate/container": "^7.30.6 || ^8.75 || ^9.0 || ^10.0 || ^11.0",
"illuminate/database": "^7.30.6 || ^8.75 || ^9.0 || ^10.0 || ^11.0",
"illuminate/support": "^7.30.6 || ^8.75 || ^9.0 || ^10.0 || ^11.0",
"symfony/console": "^5.3 || ^6.0 || ^7.0"
"illuminate/console": "^10.0 || ^11.0",
"illuminate/container": "^10.0 || ^11.0",
"illuminate/database": "^10.0 || ^11.0",
"illuminate/support": "^10.0 || ^11.0",
"symfony/console": " ^6.0 || ^7.0"
},
"require-dev": {
"mockery/mockery": "^1.3.1",
"nesbot/carbon": "^2.62.1 || ^3.0",
"orchestra/testbench": "^5.20 || ^6.25 || ^7.9 || ^8.0 || ^9.0",
"phpunit/phpunit": "^9.6 || ^10.0",
"ramsey/uuid": "^3.7 || ^4.0"
"orchestra/testbench": "^8.0 || ^9.0",
"phpunit/phpunit": "^10.0",
"ramsey/uuid": "^4.0"
},
"conflict": {
"andrey-helldar/laravel-actions": "*",
"dragon-code/laravel-migration-actions": "*"
},
"suggest": {
"doctrine/dbal": "This package must be installed if you are using Laravel 10."
},
"minimum-stability": "stable",
"prefer-stable": true,
"autoload": {
"psr-4": {
"DragonCode\\LaravelActions\\": "src"
},
"classmap": [
"polyfill"
]
"DragonCode\\LaravelActions\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests"
"Tests\\": "tests/"
}
},
"config": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,12 @@

declare(strict_types=1);

namespace DragonCode\LaravelActions\Database;

use DragonCode\LaravelActions\Action;
use DragonCode\LaravelActions\Helpers\Config;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

abstract class BaseChangeColumn extends Action
{
protected Config $config;

public function __construct()
{
$this->config = app(Config::class);
}

return new class extends Action {
public function up(): void
{
if ($this->hasTable()) {
Expand Down Expand Up @@ -59,6 +49,6 @@ protected function doesntHaveColumn(string $column): bool

protected function table(): string
{
return $this->config->table();
return app(Config::class)->table();
}
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,11 @@

declare(strict_types=1);

namespace DragonCode\LaravelActions\Database;

use DragonCode\LaravelActions\Action;
use DragonCode\LaravelActions\Helpers\Config;
use Illuminate\Support\Facades\Schema;
use RuntimeException;

class BaseRenameMigrationsActionsTableToActions extends Action
{
protected Config $config;

public function __construct()
{
$this->config = app(Config::class);
}

return new class extends Action {
public function up(): void
{
if (Schema::hasTable('migration_actions') && $this->doesntSame('migration_actions', $this->table())) {
Expand Down Expand Up @@ -50,6 +39,6 @@ protected function doesntSame(string $first, string $second): bool

protected function table(): string
{
return $this->config->table();
return app(Config::class)->table();
}
}
};

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default defineUserConfig({
editLink: true,

navbar: [
{text: '4.x', link: '/prologue/changelog/4.x.md'}
{text: '5.x', link: '/prologue/changelog/5.x.md'}
],

sidebarDepth: 1,
Expand Down
30 changes: 4 additions & 26 deletions docs/getting-started/installation/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Installation

To get the latest version of `Laravel Actions`, simply require the project using [Composer](https://getcomposer.org):
To get the latest version of `Deploy Actions for Laravel`, simply require the project using [Composer](https://getcomposer.org):

```bash
composer require dragon-code/laravel-actions
Expand All @@ -11,35 +11,13 @@ Or manually update `require` block of `composer.json` and run `composer update`
```json
{
"require": {
"dragon-code/laravel-actions": "^4.0"
"dragon-code/laravel-actions": "^5.0"
}
}
```

## Laravel Framework

Run the `php artisan vendor:publish --provider="DragonCode\LaravelActions\ServiceProvider"` console command for the config file publishing.

## Lumen Framework

This package is focused on Laravel development, but it can also be used in Lumen with some workarounds. Because Lumen works a little different, as it is like a barebone version of
Laravel and the main configuration parameters are instead located in `bootstrap/app.php`, some alterations must be made.

You can install `Laravel Actions` in `app/Providers/AppServiceProvider.php`, and uncommenting this line that registers the App Service Providers so it can properly load.

```php
// $app->register(App\Providers\AppServiceProvider::class);
```

If you are not using that line, that is usually handy to manage gracefully multiple Lumen installations, you will have to add this line of code under
the `Register Service Providers` section of your `bootstrap/app.php`.

```php
$app->register(\DragonCode\LaravelActions\ServiceProvider::class);
```

Next, you can copy the config file:
If necessary, you can publish the configuration file by calling the console command:

```bash
cp vendor/dragon-code/laravel-actions/config/actions.php config/actions.php
php artisan vendor:publish --provider="DragonCode\LaravelActions\ServiceProvider"
```
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Laravel Deploy Actions
# Deploy Actions for Laravel

![the dragon code actions](https://preview.dragon-code.pro/the-dragon-code/deploy-actions.svg?brand=laravel&mode=dark)

Expand All @@ -15,6 +15,7 @@

* Prologue
* [Upgrade Guide](prologue/upgrade-guide/index.md)
* [To 5.x from 4.x](prologue/upgrade-guide/5.x.md)
* [To 4.x from 3.x](prologue/upgrade-guide/4.x.md)
* [To 3.x from 2.x](prologue/upgrade-guide/3.x.md)
* Getting Started
Expand Down
2 changes: 1 addition & 1 deletion docs/prologue/changelog/4.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@

### Changed

- Project renamed from `Laravel Migration Actions` to `Laravel Actions` by @andrey-helldar in https://github.com/TheDragonCode/laravel-actions/pull/108
- Project renamed from `Laravel Migration Actions` to `Deploy Actions for Laravel` by @andrey-helldar in https://github.com/TheDragonCode/laravel-actions/pull/108
- Console commands have been renamed by @andrey-helldar in https://github.com/TheDragonCode/laravel-actions/pull/110
- `Names::MIGRATE` constant have been renamed to `Names::ACTIONS` by @andrey-helldar in https://github.com/TheDragonCode/laravel-actions/pull/111
- Refactored `actions:upgrade` console command by @andrey-helldar in https://github.com/TheDragonCode/laravel-actions/pull/112
Expand Down
7 changes: 7 additions & 0 deletions docs/prologue/changelog/5.x.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 5.x

## 5.0.0 - 2024-05-13

### Removed

- Removed support for Laravel Framework 7, 8 and 9 versions
1 change: 1 addition & 0 deletions docs/prologue/changelog/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Changelog

- [5.x](5.x.md)
- [4.x](4.x.md)
- [3.x](3.x.md)
2 changes: 1 addition & 1 deletion docs/prologue/license.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License

Copyright (c) 2023 Andrey Helldar
Copyright (c) 2024 Andrey Helldar

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion docs/prologue/upgrade-guide/3.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ It will do the following:

### PHP 8.0.2 Required

Laravel Actions now requires PHP 8.0.2 or greater.
Deploy Actions for Laravel now requires PHP 8.0.2 or greater.

### Composer Dependencies

Expand Down
31 changes: 31 additions & 0 deletions docs/prologue/upgrade-guide/5.x.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Upgrading To 5.x from 4.x

## High Impact Changes

- [Updating Dependencies](#updating-dependencies)

## Updating Dependencies

### PHP 8.2.0 Required

Deploy Actions for Laravel now requires PHP 8.2.0 or greater.

### Composer Dependencies

You should update the following dependencies in your application's `composer.json` file:

- `dragon-code/laravel-actions` to `^5.0`

Then you need to update the dependencies:

```bash
composer update
```

### Laravel 10

If you are using Laravel 10, then you need to install the dependency:

```bash
composer require doctrine/dbal
```
1 change: 1 addition & 0 deletions docs/prologue/upgrade-guide/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Upgrade Guide

* [Upgrading To 5.x from 4.x](5.x.md)
* [Upgrading To 4.x from 3.x](4.x.md)
* [Upgrading To 3.x from 2.x](3.x.md)
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"url": "git+ssh://[email protected]/TheDragonCode/laravel-actions.git"
},
"devDependencies": {
"@vuepress/bundler-vite": "^2.0.0-rc.8",
"@vuepress/bundler-vite": "^2.0.0-rc.9",
"@vuepress/theme-default": "^2.0.0-rc.20",
"@vueuse/core": "^7.5.5",
"dotenv": "^15.0.0",
"vuepress": "^2.0.0-rc.8"
"vuepress": "^2.0.0-rc.9"
},
"engines": {
"node": ">=20.11"
Expand Down
24 changes: 9 additions & 15 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
backupStaticAttributes="false"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="false"
convertWarningsToExceptions="false"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
verbose="true"
cacheDirectory=".phpunit.cache"
>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<coverage>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/logs/coverage"/>
Expand All @@ -29,7 +18,12 @@
</php>
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests</directory>
<directory>./tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>./src</directory>
</include>
</source>
</phpunit>
9 changes: 0 additions & 9 deletions polyfill/ShouldBeUnique.php

This file was deleted.

5 changes: 2 additions & 3 deletions src/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use DragonCode\LaravelActions\Concerns\Artisan;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Arr;

abstract class Action extends Migration
{
Expand Down Expand Up @@ -76,15 +75,15 @@ public function transactionAttempts(): int
*/
public function onEnvironment(): array
{
return Arr::wrap($this->environment);
return (array) $this->environment;
}

/**
* Determines in which environment it should not run.
*/
public function exceptEnvironment(): array
{
return Arr::wrap($this->exceptEnvironment);
return (array) $this->exceptEnvironment;
}

/**
Expand Down
Loading

0 comments on commit 63a29c3

Please sign in to comment.