From fa35c884565e382ec51778f95a1a22b4a9f297c7 Mon Sep 17 00:00:00 2001 From: freek Date: Fri, 1 Sep 2017 13:45:20 +0200 Subject: [PATCH] create L5.5 version --- .travis.yml | 1 + CHANGELOG.md | 4 ++++ README.md | 11 +---------- composer.json | 8 ++++---- .../{laravel-model-cleanup.php => model-cleanup.php} | 0 src/CleanUpModelsCommand.php | 4 ++-- src/ModelCleanupServiceProvider.php | 4 ++-- tests/DatabaseCleanupTest.php | 4 ++-- 8 files changed, 16 insertions(+), 20 deletions(-) rename config/{laravel-model-cleanup.php => model-cleanup.php} (100%) diff --git a/.travis.yml b/.travis.yml index da7f7cd..b95d9ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ language: php php: - 7.0 - 7.1 + - 7.2 env: matrix: diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a7c661..0d308cc 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to `laravel-model-cleanup` will be documented in this file +## 2.0.0 - 2016-09-01 +- added support for Laravel 5.5 +- renamed config file from `laravel-model-cleanup` to `model-cleanup` + ### 1.2.0 - 2016-08-10 - allow v3 of php parser diff --git a/README.md b/README.md index 2a97ab6..fb61776 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ You're free to use this package (it's [MIT-licensed](LICENSE.md)), but if it mak Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium. -The best postcards are published [on our website](https://spatie.be/en/opensource/postcards). +All postcards are published [on our website](https://spatie.be/en/opensource/postcards). ## Installation @@ -47,15 +47,6 @@ You can install the package via composer: composer require spatie/laravel-model-cleanup ``` -Next up, the service provider must be registered: - -```php -'providers' => [ - ... - Spatie\ModelCleanup\ModelCleanupServiceProvider::class, - -]; -``` Next, you must publish the config file: ```bash diff --git a/composer.json b/composer.json index b06d424..e588231 100644 --- a/composer.json +++ b/composer.json @@ -23,13 +23,13 @@ ], "require": { "php" : "^7.0", - "illuminate/support": "~5.2.0|~5.3.0|~5.4.0", + "illuminate/support": "~5.5.0", "nesbot/carbon": "^1.0", - "nikic/php-parser":"^2.0|^3.0" + "nikic/php-parser":"^3.0" }, "require-dev": { - "phpunit/phpunit": "^5.0", - "orchestra/testbench":"^3.2", + "phpunit/phpunit": "^6.3", + "orchestra/testbench":"~3.5.0", "mockery/mockery": "^0.9.5" }, "autoload": { diff --git a/config/laravel-model-cleanup.php b/config/model-cleanup.php similarity index 100% rename from config/laravel-model-cleanup.php rename to config/model-cleanup.php diff --git a/src/CleanUpModelsCommand.php b/src/CleanUpModelsCommand.php index 7940ec8..0950164 100644 --- a/src/CleanUpModelsCommand.php +++ b/src/CleanUpModelsCommand.php @@ -47,12 +47,12 @@ public function handle() protected function getModelsThatShouldBeCleanedUp() : Collection { - $directories = config('laravel-model-cleanup.directories'); + $directories = config('model-cleanup.directories'); $modelsFromDirectories = $this->getAllModelsFromEachDirectory($directories); return $modelsFromDirectories - ->merge(collect(config('laravel-model-cleanup.models'))) + ->merge(collect(config('model-cleanup.models'))) ->filter(function ($modelClass) { return in_array(GetsCleanedUp::class, class_implements($modelClass)); }); diff --git a/src/ModelCleanupServiceProvider.php b/src/ModelCleanupServiceProvider.php index bb13fb4..8b470ad 100644 --- a/src/ModelCleanupServiceProvider.php +++ b/src/ModelCleanupServiceProvider.php @@ -9,13 +9,13 @@ class ModelCleanupServiceProvider extends ServiceProvider public function boot() { $this->publishes([ - __DIR__.'/../config/laravel-model-cleanup.php' => config_path('laravel-model-cleanup.php'), + __DIR__.'/../config/model-cleanup.php' => config_path('model-cleanup.php'), ], 'config'); } public function register() { - $this->mergeConfigFrom(__DIR__.'/../config/laravel-model-cleanup.php', 'laravel-model-cleanup'); + $this->mergeConfigFrom(__DIR__.'/../config/model-cleanup.php', 'model-cleanup'); $this->app->bind('command.clean:models', CleanUpModelsCommand::class); diff --git a/tests/DatabaseCleanupTest.php b/tests/DatabaseCleanupTest.php index 0f5432a..be61f1f 100644 --- a/tests/DatabaseCleanupTest.php +++ b/tests/DatabaseCleanupTest.php @@ -24,7 +24,7 @@ public function it_can_cleanup_the_models_specified_in_the_config_file() { $this->assertCount(20, CleanableItem::all()); - $this->app['config']->set('laravel-model-cleanup', + $this->app['config']->set('model-cleanup', [ 'models' => [CleanableItem::class], 'directories' => [], @@ -61,7 +61,7 @@ public function it_leaves_models_without_the_GetCleanUp_trait_untouched() protected function setConfigThatCleansUpDirectory() { - $this->app['config']->set('laravel-model-cleanup', + $this->app['config']->set('model-cleanup', [ 'models' => [], 'directories' => [__DIR__.'/Models'],