diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 124dc3f..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,4 +0,0 @@ -# Help me support this package - -ko_fi: DarkGhostHunter -custom: ['https://paypal.me/darkghosthunter'] \ No newline at end of file diff --git a/composer.json b/composer.json index d4830a6..01ce544 100644 --- a/composer.json +++ b/composer.json @@ -1,54 +1,54 @@ { - "name": "darkghosthunter/laraconfig", - "description": "Per-user settings repository system for Laravel", - "minimum-stability": "dev", - "prefer-stable": true, - "license": "MIT", - "authors": [ - { - "name": "Italo Baeza C.", - "email": "darkghosthunter@gmail.com" + "name": "synergitech/laravel-multiconfig", + "description": "Per-user settings repository system for Laravel", + "minimum-stability": "dev", + "prefer-stable": true, + "license": "MIT", + "authors": [ + { + "name": "Italo Baeza C.", + "email": "darkghosthunter@gmail.com" + } + ], + "require": { + "php": ">=8.0", + "illuminate/database": "^8.43", + "illuminate/support": "^8.43", + "illuminate/collections": "^8.43", + "illuminate/config": "^8.43", + "illuminate/cache": "^8.43", + "symfony/console": "^5.3" + }, + "require-dev": { + "mockery/mockery": "^1.4.3", + "orchestra/testbench": "^6.19", + "phpunit/phpunit": "^9.5.4" + }, + "autoload-dev": { + "psr-4": { + "Tests\\": "tests" + } + }, + "autoload": { + "psr-4": { + "SynergiTech\\Multiconfig\\": "src" + } + }, + "extra": { + "laravel": { + "providers": [ + "SynergiTech\\Multiconfig\\MulticonfigServiceProvider" + ], + "aliases": { + "Setting": "SynergiTech\\Multiconfig\\Facades\\Setting" + } + } + }, + "scripts": { + "test": "vendor/bin/phpunit --coverage-clover build/logs/clover.xml", + "test-coverage": "vendor/bin/phpunit --coverage-html coverage" + }, + "config": { + "sort-packages": true } - ], - "require": { - "php": ">=8.0", - "illuminate/database": "^8.43", - "illuminate/support": "^8.43", - "illuminate/collections": "^8.43", - "illuminate/config": "^8.43", - "illuminate/cache": "^8.43", - "symfony/console": "^5.3" - }, - "require-dev": { - "mockery/mockery": "^1.4.3", - "orchestra/testbench": "^6.19", - "phpunit/phpunit": "^9.5.4" - }, - "autoload-dev": { - "psr-4": { - "Tests\\": "tests" - } - }, - "autoload": { - "psr-4": { - "DarkGhostHunter\\Laraconfig\\": "src" - } - }, - "extra": { - "laravel": { - "providers": [ - "DarkGhostHunter\\Laraconfig\\LaraconfigServiceProvider" - ], - "aliases": { - "Setting": "DarkGhostHunter\\Laraconfig\\Facades\\Setting" - } - } - }, - "scripts": { - "test": "vendor/bin/phpunit --coverage-clover build/logs/clover.xml", - "test-coverage": "vendor/bin/phpunit --coverage-html coverage" - }, - "config": { - "sort-packages": true - } } diff --git a/config/laraconfig.php b/config/laraconfig.php index 4a60b5d..7bab80a 100644 --- a/config/laraconfig.php +++ b/config/laraconfig.php @@ -27,10 +27,10 @@ */ 'cache' => [ - 'enable' => env('LARACONFIG_CACHE', false), - 'store' => env('LARACONFIG_STORE'), + 'enable' => env('MULTICONFIG_CACHE', false), + 'store' => env('MULTICONFIG_STORE'), 'duration' => 60 * 60 * 3, // Store the settings for 3 hours - 'prefix' => 'laraconfig', + 'prefix' => 'multiconfig', 'automatic' => true, // Regenerate the cache before garbage collection. ] -]; \ No newline at end of file +]; diff --git a/src/Console/Commands/CleanCommand.php b/src/Console/Commands/CleanCommand.php index e5afa99..2b677e6 100644 --- a/src/Console/Commands/CleanCommand.php +++ b/src/Console/Commands/CleanCommand.php @@ -1,8 +1,8 @@ orDoesntHave('metadata') ->delete(); } -} \ No newline at end of file +} diff --git a/src/Console/Commands/MigrateCommand.php b/src/Console/Commands/MigrateCommand.php index c13b6de..9a0e7cb 100644 --- a/src/Console/Commands/MigrateCommand.php +++ b/src/Console/Commands/MigrateCommand.php @@ -1,9 +1,9 @@ $value, }; } -} \ No newline at end of file +} diff --git a/src/Eloquent/Metadata.php b/src/Eloquent/Metadata.php index fc3dd1d..52c00a6 100644 --- a/src/Eloquent/Metadata.php +++ b/src/Eloquent/Metadata.php @@ -1,6 +1,6 @@ cache->invalidateIfNotInvalidated(); // Mark the cache to be regenerated once is destructed. $this->cache->regenerateOnExit(); - } elseif (config('laraconfig.cache.enable', false)) { + } elseif (config('multiconfig.cache.enable', false)) { [$morph, $id] = $this->getMorphs('settable', null, null); cache() - ->store(config('laraconfig.cache.store')) + ->store(config('multiconfig.cache.store')) ->forget( MorphManySettings::generateKeyForModel( - config('laraconfig.cache.prefix'), + config('multiconfig.cache.prefix'), $this->getAttribute($morph), $this->getAttribute($id) ) diff --git a/src/Facades/Setting.php b/src/Facades/Setting.php index cb25779..86efff4 100644 --- a/src/Facades/Setting.php +++ b/src/Facades/Setting.php @@ -1,13 +1,13 @@ |\DarkGhostHunter\Laraconfig\Eloquent\Setting[] $settings + * @property-read \SynergiTech\Multiconfig\SettingsCollection<\SynergiTech\Multiconfig\Eloquent\Setting>|\SynergiTech\Multiconfig\Eloquent\Setting[] $settings * * @method \Illuminate\Database\Eloquent\Builder|static whereConfig(string|array $name, string $operator = null, $value = null, string $boolean = 'and') * @method \Illuminate\Database\Eloquent\Builder|static orWhereConfig(string|array $name, string $operator = null, $value = null) @@ -17,7 +17,7 @@ trait HasConfig /** * Returns the settings relationship. * - * @return \DarkGhostHunter\Laraconfig\MorphManySettings + * @return \SynergiTech\Multiconfig\MorphManySettings */ public function settings(): MorphManySettings { diff --git a/src/Migrator/Data.php b/src/Migrator/Data.php index 8b7f2f5..be85619 100644 --- a/src/Migrator/Data.php +++ b/src/Migrator/Data.php @@ -1,6 +1,6 @@ models = new Collection(); } -} \ No newline at end of file +} diff --git a/src/Migrator/Migrator.php b/src/Migrator/Migrator.php index 3811230..c752c96 100644 --- a/src/Migrator/Migrator.php +++ b/src/Migrator/Migrator.php @@ -1,6 +1,6 @@ app->environment('production') && ! $this->input->getOption('force'); } -} \ No newline at end of file +} diff --git a/src/Migrator/Pipes/ConfirmSettingsToDelete.php b/src/Migrator/Pipes/ConfirmSettingsToDelete.php index 5c9ef67..370e143 100644 --- a/src/Migrator/Pipes/ConfirmSettingsToDelete.php +++ b/src/Migrator/Pipes/ConfirmSettingsToDelete.php @@ -1,10 +1,10 @@ app->environment('production') && !$this->input->getOption('force'); } -} \ No newline at end of file +} diff --git a/src/Migrator/Pipes/CreateNewMetadata.php b/src/Migrator/Pipes/CreateNewMetadata.php index 1569c29..107eb2b 100644 --- a/src/Migrator/Pipes/CreateNewMetadata.php +++ b/src/Migrator/Pipes/CreateNewMetadata.php @@ -1,12 +1,12 @@ where('metadata_id', $old->getKey())->lazyById() as $setting) { Setting::query() ->insert([ diff --git a/src/Migrator/Pipes/EnsureFromTargetsExist.php b/src/Migrator/Pipes/EnsureFromTargetsExist.php index c9f78e5..ccd03c2 100644 --- a/src/Migrator/Pipes/EnsureFromTargetsExist.php +++ b/src/Migrator/Pipes/EnsureFromTargetsExist.php @@ -1,9 +1,9 @@ input->getOption('flush-cache')) { // If is not using a cache, we will not flush anything and bail. - if (!$this->config->get('laraconfig.cache.enable', false)) { - throw new RuntimeException('Cannot flush cache. Laraconfig cache is not enabled.'); + if (!$this->config->get('multiconfig.cache.enable', false)) { + throw new RuntimeException('Cannot flush cache. Multiconfig cache is not enabled.'); } - $store = $this->config->get('laraconfig.cache.store'); + $store = $this->config->get('multiconfig.cache.store'); // We will prompt the user if needed, and wait for its confirmation. if ($this->shouldPrompt() && !$this->confirms($store)) { @@ -87,4 +87,4 @@ protected function confirms(string $store = null): bool return $this->output->confirm("The cache store $store will be flushed completely. Proceed?"); } -} \ No newline at end of file +} diff --git a/src/Migrator/Pipes/InvalidateCache.php b/src/Migrator/Pipes/InvalidateCache.php index 723f98c..f346d4b 100644 --- a/src/Migrator/Pipes/InvalidateCache.php +++ b/src/Migrator/Pipes/InvalidateCache.php @@ -1,11 +1,11 @@ invalidateCache && ! $this->input->getOption('flush-cache') - && $this->config->get('laraconfig.cache.enable'); + && $this->config->get('multiconfig.cache.enable'); } /** @@ -77,9 +77,9 @@ protected function shouldInvalidateCacheKeys(Data $data): bool */ protected function forgetModelCacheKeys(Data $data): int { - $store = $this->cache->store($this->config->get('laraconfig.cache.store')); + $store = $this->cache->store($this->config->get('multiconfig.cache.store')); - $prefix = $this->config->get('laraconfig.cache.prefix'); + $prefix = $this->config->get('multiconfig.cache.prefix'); $count = 0; @@ -113,4 +113,4 @@ protected function querySettable(Model $settable): LazyCollection ->select($name = $settable->getKeyName()) ->lazyById(column: $name); } -} \ No newline at end of file +} diff --git a/src/Migrator/Pipes/LoadDeclarations.php b/src/Migrator/Pipes/LoadDeclarations.php index 142dda3..1f23ba4 100644 --- a/src/Migrator/Pipes/LoadDeclarations.php +++ b/src/Migrator/Pipes/LoadDeclarations.php @@ -1,10 +1,10 @@ declarations->has($metadata->name); }); } -} \ No newline at end of file +} diff --git a/src/Migrator/Pipes/UpdateExistingMetadata.php b/src/Migrator/Pipes/UpdateExistingMetadata.php index 325b328..7ec5a41 100644 --- a/src/Migrator/Pipes/UpdateExistingMetadata.php +++ b/src/Migrator/Pipes/UpdateExistingMetadata.php @@ -1,12 +1,12 @@ declarations->filter(static function (Declaration $declaration) use ($data): bool { - /** @var \DarkGhostHunter\Laraconfig\Eloquent\Metadata $metadata */ + /** @var \SynergiTech\Multiconfig\Eloquent\Metadata $metadata */ if ($metadata = $data->metadata->get($declaration->name)) { $placeholder = $declaration->toMetadata(); @@ -80,14 +80,14 @@ protected function getUpdatableMetadata(Data $data): Collection /** * Updates each existing metadata from its declaration of the same name. * - * @param \DarkGhostHunter\Laraconfig\Migrator\Data $data - * @param \DarkGhostHunter\Laraconfig\Registrar\Declaration $declaration + * @param \SynergiTech\Multiconfig\Migrator\Data $data + * @param \SynergiTech\Multiconfig\Registrar\Declaration $declaration * * @return int */ protected function updateMetadata(Data $data, Declaration $declaration): int { - /** @var \DarkGhostHunter\Laraconfig\Eloquent\Metadata $metadata */ + /** @var \SynergiTech\Multiconfig\Eloquent\Metadata $metadata */ $metadata = $data->metadata->get($declaration->name); $metadata->forceFill([ @@ -113,8 +113,8 @@ protected function updateMetadata(Data $data, Declaration $declaration): int /** * Update each child setting (of each user) using the declaration procedure. * - * @param \DarkGhostHunter\Laraconfig\Registrar\Declaration $declaration - * @param \DarkGhostHunter\Laraconfig\Eloquent\Metadata $metadata + * @param \SynergiTech\Multiconfig\Registrar\Declaration $declaration + * @param \SynergiTech\Multiconfig\Eloquent\Metadata $metadata * * @return int */ @@ -135,4 +135,4 @@ protected function updateSettingValues(Declaration $declaration, Metadata $metad return $count; } -} \ No newline at end of file +} diff --git a/src/MorphManySettings.php b/src/MorphManySettings.php index ed7176d..94c38a9 100644 --- a/src/MorphManySettings.php +++ b/src/MorphManySettings.php @@ -1,8 +1,8 @@ get('laraconfig.cache.enable', false)) { + if ($config->get('multiconfig.cache.enable', false)) { $this->cache = SettingsCache::make($config, app(Factory::class), $parent); } // And filter the bags if the model has stated them. $this->bags = Arr::wrap( - method_exists($parent, 'filterBags') ? $parent->filterBags() : $config->get('laraconfig.default', 'users') + method_exists($parent, 'filterBags') ? $parent->filterBags() : $config->get('multiconfig.default', 'users') ); } diff --git a/src/LaraconfigServiceProvider.php b/src/MulticonfigServiceProvider.php similarity index 84% rename from src/LaraconfigServiceProvider.php rename to src/MulticonfigServiceProvider.php index 6e03341..16f645f 100644 --- a/src/LaraconfigServiceProvider.php +++ b/src/MulticonfigServiceProvider.php @@ -1,8 +1,8 @@ mergeConfigFrom(__DIR__.'/../config/laraconfig.php', 'laraconfig'); + $this->mergeConfigFrom(__DIR__.'/../config/multiconfig.php', 'multiconfig'); $this->app->singleton(SettingRegistrar::class, static function($app): SettingRegistrar { return new SettingRegistrar( @@ -58,7 +58,7 @@ public function boot(): void Console\Commands\CleanCommand::class, ]); - $this->publishes([__DIR__.'/../config/laraconfig.php' => config_path('laraconfig.php')], 'config'); + $this->publishes([__DIR__.'/../config/multiconfig.php' => config_path('multiconfig.php')], 'config'); $this->publishes(iterator_to_array($this->migrationPathNames()), 'migrations'); } diff --git a/src/Registrar/Declaration.php b/src/Registrar/Declaration.php index 561a0de..0e4ee42 100644 --- a/src/Registrar/Declaration.php +++ b/src/Registrar/Declaration.php @@ -1,9 +1,9 @@ declarations->put($name, $declaration = new Declaration($name, $this->config->get('laraconfig.default'))); + $this->declarations->put($name, $declaration = new Declaration($name, $this->config->get('multiconfig.default'))); return $declaration; } diff --git a/src/SettingsCache.php b/src/SettingsCache.php index 3c9e052..8fcbb39 100644 --- a/src/SettingsCache.php +++ b/src/SettingsCache.php @@ -1,6 +1,6 @@ settings->regeneratesOnExit = $this->automaticRegeneration; } - + /** * representation of object. * @@ -192,14 +192,14 @@ public function unserialize($data): void public static function make(Config $config, Factory $factory, Model $model): static { return new static( - $factory->store($config->get('laraconfig.cache.store')), + $factory->store($config->get('multiconfig.cache.store')), MorphManySettings::generateKeyForModel( - $config->get('laraconfig.cache.prefix', 'laraconfig'), + $config->get('multiconfig.cache.prefix', 'multiconfig'), $model->getMorphClass(), $model->getKey() ), - $config->get('laraconfig.cache.ttl', 60 * 60 * 3), - $config->get('laraconfig.cache.automatic', true), + $config->get('multiconfig.cache.ttl', 60 * 60 * 3), + $config->get('multiconfig.cache.automatic', true), ); } } diff --git a/src/SettingsCollection.php b/src/SettingsCollection.php index 51c438a..06dde98 100644 --- a/src/SettingsCollection.php +++ b/src/SettingsCollection.php @@ -1,8 +1,8 @@ boolean(); diff --git a/tests/Console/Commands/CleanCommandTest.php b/tests/Console/Commands/CleanCommandTest.php index 04a6a84..8e924a8 100644 --- a/tests/Console/Commands/CleanCommandTest.php +++ b/tests/Console/Commands/CleanCommandTest.php @@ -2,8 +2,8 @@ namespace Tests\Console\Commands; -use DarkGhostHunter\Laraconfig\Eloquent\Metadata; -use DarkGhostHunter\Laraconfig\Eloquent\Setting; +use SynergiTech\Multiconfig\Eloquent\Metadata; +use SynergiTech\Multiconfig\Eloquent\Setting; use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Facades\DB; use Tests\BaseTestCase; @@ -86,4 +86,4 @@ public function test_cleans_orphaned_settings(): void $this->assertDatabaseMissing('user_settings', ['metadata_id' => 1, 'settable_id' => 99]); $this->assertDatabaseMissing('user_settings', ['metadata_id' => 99, 'settable_id' => 99]); } -} \ No newline at end of file +} diff --git a/tests/Console/Commands/MigrateCommandTest.php b/tests/Console/Commands/MigrateCommandTest.php index e1ec8ec..c1c9a43 100644 --- a/tests/Console/Commands/MigrateCommandTest.php +++ b/tests/Console/Commands/MigrateCommandTest.php @@ -2,11 +2,11 @@ namespace Tests\Console\Commands; -use DarkGhostHunter\Laraconfig\Eloquent\Metadata; -use DarkGhostHunter\Laraconfig\Eloquent\Setting as SettingModel; -use DarkGhostHunter\Laraconfig\Facades\Setting; -use DarkGhostHunter\Laraconfig\Migrator\Data; -use DarkGhostHunter\Laraconfig\Registrar\SettingRegistrar; +use SynergiTech\Multiconfig\Eloquent\Metadata; +use SynergiTech\Multiconfig\Eloquent\Setting as SettingModel; +use SynergiTech\Multiconfig\Facades\Setting; +use SynergiTech\Multiconfig\Migrator\Data; +use SynergiTech\Multiconfig\Registrar\SettingRegistrar; use Illuminate\Contracts\Cache\Factory; use Illuminate\Contracts\Cache\Store; use Illuminate\Database\Eloquent\Model; @@ -640,7 +640,7 @@ public function test_exception_when_models_use_same_table(): void public function test_doesnt_regenerates_cache_when_no_changes(): void { - config()->set('laraconfig.cache.enable', true); + config()->set('multiconfig.cache.enable', true); Metadata::make()->forceFill([ 'name' => 'foo', @@ -671,12 +671,12 @@ public function test_invalidates_cache_when_updates_setting(): void $this->resetDeclarations(); - config()->set('laraconfig.cache.enable', true); - config()->set('laraconfig.cache.store', 'foo'); + config()->set('multiconfig.cache.enable', true); + config()->set('multiconfig.cache.store', 'foo'); $store = cache()->store(); - $store->forever('laraconfig|Tests\Dummies\DummyModel|1', 'foo'); + $store->forever('multiconfig|Tests\Dummies\DummyModel|1', 'foo'); /** @var \Mockery\MockInterface $cache */ $cache = $this->swap(Factory::class, Mockery::mock(Factory::class)); @@ -691,7 +691,7 @@ public function test_invalidates_cache_when_updates_setting(): void ->assertExitCode(0) ->execute(); - static::assertNull($store->get('laraconfig|Tests\Dummies\DummyModel|1')); + static::assertNull($store->get('multiconfig|Tests\Dummies\DummyModel|1')); } public function test_invalidates_cache_when_creates_setting(): void @@ -704,12 +704,12 @@ public function test_invalidates_cache_when_creates_setting(): void $this->resetDeclarations(); - config()->set('laraconfig.cache.enable', true); - config()->set('laraconfig.cache.store', 'foo'); + config()->set('multiconfig.cache.enable', true); + config()->set('multiconfig.cache.store', 'foo'); $store = cache()->store(); - $store->forever('laraconfig|Tests\Dummies\DummyModel|1', 'foo'); + $store->forever('multiconfig|Tests\Dummies\DummyModel|1', 'foo'); /** @var \Mockery\MockInterface $cache */ $cache = $this->swap(Factory::class, Mockery::mock(Factory::class)); @@ -724,7 +724,7 @@ public function test_invalidates_cache_when_creates_setting(): void ->assertExitCode(0) ->execute(); - static::assertNull($store->get('laraconfig|Tests\Dummies\DummyModel|1')); + static::assertNull($store->get('multiconfig|Tests\Dummies\DummyModel|1')); } public function test_invalidates_cache_when_deletes_setting(): void @@ -737,12 +737,12 @@ public function test_invalidates_cache_when_deletes_setting(): void $this->resetDeclarations(); - config()->set('laraconfig.cache.enable', true); - config()->set('laraconfig.cache.store', 'foo'); + config()->set('multiconfig.cache.enable', true); + config()->set('multiconfig.cache.store', 'foo'); $store = cache()->store(); - $store->forever('laraconfig|Tests\Dummies\DummyModel|1', 'foo'); + $store->forever('multiconfig|Tests\Dummies\DummyModel|1', 'foo'); /** @var \Mockery\MockInterface $cache */ $cache = $this->swap(Factory::class, Mockery::mock(Factory::class)); @@ -755,13 +755,13 @@ public function test_invalidates_cache_when_deletes_setting(): void ->assertExitCode(0) ->execute(); - static::assertNull($store->get('laraconfig|Tests\Dummies\DummyModel|1')); + static::assertNull($store->get('multiconfig|Tests\Dummies\DummyModel|1')); } public function test_flushes_cache(): void { - config()->set('laraconfig.cache.enable', true); - config()->set('laraconfig.cache.store', 'foo'); + config()->set('multiconfig.cache.enable', true); + config()->set('multiconfig.cache.store', 'foo'); Setting::name('foo'); @@ -780,7 +780,7 @@ public function test_flushes_cache(): void public function test_doesnt_flushes_cache_if_not_enabled(): void { - config()->set('laraconfig.cache.enable', false); + config()->set('multiconfig.cache.enable', false); Setting::name('foo'); @@ -789,15 +789,15 @@ public function test_doesnt_flushes_cache_if_not_enabled(): void $cache->shouldNotReceive('store'); $this->artisan('settings:migrate', ['--flush-cache' => true]) - ->expectsOutput('Cannot flush cache. Laraconfig cache is not enabled.') + ->expectsOutput('Cannot flush cache. Multiconfig cache is not enabled.') ->assertExitCode(1) ->run(); } public function test_confirms_cache_flush_on_production(): void { - config()->set('laraconfig.cache.enable', true); - config()->set('laraconfig.cache.store', 'foo'); + config()->set('multiconfig.cache.enable', true); + config()->set('multiconfig.cache.store', 'foo'); Setting::name('foo'); @@ -824,4 +824,4 @@ public function tearDown(): void parent::tearDown(); } -} \ No newline at end of file +} diff --git a/tests/Console/Commands/PublishCommandTest.php b/tests/Console/Commands/PublishCommandTest.php index 7e75bcd..14a5654 100644 --- a/tests/Console/Commands/PublishCommandTest.php +++ b/tests/Console/Commands/PublishCommandTest.php @@ -2,11 +2,11 @@ namespace Tests\Console\Commands; -use DarkGhostHunter\Laraconfig\Eloquent\Metadata; -use DarkGhostHunter\Laraconfig\Eloquent\Setting as SettingModel; -use DarkGhostHunter\Laraconfig\Facades\Setting; -use DarkGhostHunter\Laraconfig\Migrator\Data; -use DarkGhostHunter\Laraconfig\Registrar\SettingRegistrar; +use SynergiTech\Multiconfig\Eloquent\Metadata; +use SynergiTech\Multiconfig\Eloquent\Setting as SettingModel; +use SynergiTech\Multiconfig\Facades\Setting; +use SynergiTech\Multiconfig\Migrator\Data; +use SynergiTech\Multiconfig\Registrar\SettingRegistrar; use Illuminate\Contracts\Cache\Factory; use Illuminate\Contracts\Cache\Store; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Dummies/DummyModel.php b/tests/Dummies/DummyModel.php index e6555a2..5b4085f 100644 --- a/tests/Dummies/DummyModel.php +++ b/tests/Dummies/DummyModel.php @@ -2,7 +2,7 @@ namespace Tests\Dummies; -use DarkGhostHunter\Laraconfig\HasConfig; +use SynergiTech\Multiconfig\HasConfig; use Illuminate\Database\Eloquent\Model; /** @@ -13,4 +13,4 @@ class DummyModel extends Model use HasConfig; protected $table = 'users'; -} \ No newline at end of file +} diff --git a/tests/Dummies/DummyModelAdminBag.php b/tests/Dummies/DummyModelAdminBag.php index e37d77d..bb02f00 100644 --- a/tests/Dummies/DummyModelAdminBag.php +++ b/tests/Dummies/DummyModelAdminBag.php @@ -2,7 +2,7 @@ namespace Tests\Dummies; -use DarkGhostHunter\Laraconfig\HasConfig; +use SynergiTech\Multiconfig\HasConfig; use Illuminate\Database\Eloquent\Model; class DummyModelAdminBag extends Model @@ -14,4 +14,4 @@ class DummyModelAdminBag extends Model protected function getSettingBags(): string|array { return ['admins']; } -} \ No newline at end of file +} diff --git a/tests/Dummies/DummyModelWithoutSettings.php b/tests/Dummies/DummyModelWithoutSettings.php index b5f6a9d..3ec8769 100644 --- a/tests/Dummies/DummyModelWithoutSettings.php +++ b/tests/Dummies/DummyModelWithoutSettings.php @@ -2,10 +2,10 @@ namespace Tests\Dummies; -use DarkGhostHunter\Laraconfig\HasConfig; +use SynergiTech\Multiconfig\HasConfig; use Illuminate\Database\Eloquent\Model; class DummyModelWithoutSettings extends Model { protected $table = 'users'; -} \ No newline at end of file +} diff --git a/tests/Dummies/settings_all.php b/tests/Dummies/settings_all.php index b685a3f..3d77243 100644 --- a/tests/Dummies/settings_all.php +++ b/tests/Dummies/settings_all.php @@ -1,6 +1,6 @@ array(); Setting::name('boolean')->boolean(); @@ -8,4 +8,4 @@ Setting::name('datetime')->datetime(); Setting::name('float')->float(); Setting::name('integer')->integer(); -Setting::name('string')->string(); \ No newline at end of file +Setting::name('string')->string(); diff --git a/tests/Dummies/settings_migrate_after.php b/tests/Dummies/settings_migrate_after.php index 12057cc..af4fbc5 100644 --- a/tests/Dummies/settings_migrate_after.php +++ b/tests/Dummies/settings_migrate_after.php @@ -1,7 +1,7 @@ default('new_default'); @@ -12,4 +12,4 @@ ->from('baz') ->using(static function (Model $setting): string { return Arr::first($setting->value ?? $setting->default); - }); \ No newline at end of file + }); diff --git a/tests/Dummies/settings_migrate_prepare.php b/tests/Dummies/settings_migrate_prepare.php index f289e99..dde7218 100644 --- a/tests/Dummies/settings_migrate_prepare.php +++ b/tests/Dummies/settings_migrate_prepare.php @@ -1,9 +1,9 @@ default('foo_default'); Setting::name('bar')->boolean()->default(false)->bag('bar_bag'); -Setting::name('baz')->array()->default(['alpha', 'bravo', 'charlie']); \ No newline at end of file +Setting::name('baz')->array()->default(['alpha', 'bravo', 'charlie']); diff --git a/tests/Dummies/settings_normal.php b/tests/Dummies/settings_normal.php index 363fb71..1194c48 100644 --- a/tests/Dummies/settings_normal.php +++ b/tests/Dummies/settings_normal.php @@ -1,9 +1,9 @@ default('red'); Setting::name('notify')->boolean()->default('false')->bag('admins'); -Setting::name('birthday')->datetime(); \ No newline at end of file +Setting::name('birthday')->datetime(); diff --git a/tests/Eloquent/Models/SettingTest.php b/tests/Eloquent/Models/SettingTest.php index 86bfea5..e3d9600 100644 --- a/tests/Eloquent/Models/SettingTest.php +++ b/tests/Eloquent/Models/SettingTest.php @@ -2,10 +2,10 @@ namespace Tests\Eloquent\Models; -use DarkGhostHunter\Laraconfig\Eloquent\Metadata; -use DarkGhostHunter\Laraconfig\Eloquent\Scopes\AddMetadata; -use DarkGhostHunter\Laraconfig\Eloquent\Setting; -use DarkGhostHunter\Laraconfig\SettingsCache; +use SynergiTech\Multiconfig\Eloquent\Metadata; +use SynergiTech\Multiconfig\Eloquent\Scopes\AddMetadata; +use SynergiTech\Multiconfig\Eloquent\Setting; +use SynergiTech\Multiconfig\SettingsCache; use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Carbon; use Illuminate\Support\Collection; @@ -52,7 +52,7 @@ protected function defineDatabaseMigrations(): void public function test_adds_metadata(): void { - /** @var \DarkGhostHunter\Laraconfig\Eloquent\Setting $setting */ + /** @var \SynergiTech\Multiconfig\Eloquent\Setting $setting */ $setting = Setting::make() ->setRawAttributes(['value' => 'quz']) ->forceFill([ @@ -292,7 +292,7 @@ public function test_enabled_or_disabled(): void $this->assertDatabaseHas('user_settings', ['id' => 1, 'is_enabled' => true]); } - public function test_set_invalidates_cache_of_laraconfig(): void + public function test_set_invalidates_cache_of_multiconfig(): void { $this->setting->fill(['value' => 'foo'])->save(); @@ -310,9 +310,9 @@ public function test_set_invalidates_cache_of_laraconfig(): void public function test_set_invalidates_cache_manually(): void { - config()->set('laraconfig.cache.enable', true); + config()->set('multiconfig.cache.enable', true); - cache()->store()->forever('laraconfig|bar|1', 'foo'); + cache()->store()->forever('multiconfig|bar|1', 'foo'); $this->setting->fill(['value' => 'foo'])->save(); @@ -320,7 +320,7 @@ public function test_set_invalidates_cache_manually(): void $setting->set('bar'); - static::assertNull(cache()->store()->get('laraconfig|bar|1')); + static::assertNull(cache()->store()->get('multiconfig|bar|1')); } public function test_adds_metadata_on_select_query(): void @@ -346,4 +346,4 @@ public function test_disables_add_metadata_scope(): void Setting::query()->withoutGlobalScope(AddMetadata::class)->toSql() ); } -} \ No newline at end of file +} diff --git a/tests/Eloquent/Scopes/FilterBySettingTest.php b/tests/Eloquent/Scopes/FilterBySettingTest.php index e41cd9e..8610e47 100644 --- a/tests/Eloquent/Scopes/FilterBySettingTest.php +++ b/tests/Eloquent/Scopes/FilterBySettingTest.php @@ -2,10 +2,10 @@ namespace Tests\Eloquent\Scopes; -use DarkGhostHunter\Laraconfig\Eloquent\Metadata; -use DarkGhostHunter\Laraconfig\Eloquent\Scopes\AddMetadata; -use DarkGhostHunter\Laraconfig\Eloquent\Setting; -use DarkGhostHunter\Laraconfig\HasConfig; +use SynergiTech\Multiconfig\Eloquent\Metadata; +use SynergiTech\Multiconfig\Eloquent\Scopes\AddMetadata; +use SynergiTech\Multiconfig\Eloquent\Setting; +use SynergiTech\Multiconfig\HasConfig; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; use Illuminate\Foundation\Testing\RefreshDatabase; diff --git a/tests/HasConfigTest.php b/tests/HasConfigTest.php index 97a1ddd..57663b2 100644 --- a/tests/HasConfigTest.php +++ b/tests/HasConfigTest.php @@ -2,11 +2,11 @@ namespace Tests; -use DarkGhostHunter\Laraconfig\Eloquent\Metadata; -use DarkGhostHunter\Laraconfig\Eloquent\Scopes\FilterBags; -use DarkGhostHunter\Laraconfig\Eloquent\Setting; -use DarkGhostHunter\Laraconfig\HasConfig; -use DarkGhostHunter\Laraconfig\SettingsCollection; +use SynergiTech\Multiconfig\Eloquent\Metadata; +use SynergiTech\Multiconfig\Eloquent\Scopes\FilterBags; +use SynergiTech\Multiconfig\Eloquent\Setting; +use SynergiTech\Multiconfig\HasConfig; +use SynergiTech\Multiconfig\SettingsCollection; use Error; use Exception; use Illuminate\Contracts\Cache\Factory; @@ -181,7 +181,7 @@ public function test_model_sets_config_forcefully(): void public function test_model_sets_config_not_forcefully(): void { - /** @var \DarkGhostHunter\Laraconfig\HasConfig $user */ + /** @var \SynergiTech\Multiconfig\HasConfig $user */ $user = DummyModel::find(1); $user->settings->disable('foo'); @@ -386,7 +386,7 @@ public function filterBags(): string } }; - /** @var \DarkGhostHunter\Laraconfig\HasConfig $instance */ + /** @var \SynergiTech\Multiconfig\HasConfig $instance */ $instance = $model->forceCreate([ 'name' => 'dummy', 'email' => 'dummy@email.com', @@ -409,7 +409,7 @@ public function test_sets_default(): void public function test_sets_default_from_database(): void { - /** @var \DarkGhostHunter\Laraconfig\Eloquent\Setting $setting */ + /** @var \SynergiTech\Multiconfig\Eloquent\Setting $setting */ $setting = Setting::find(1); $setting->setRawAttributes(['default' => null])->syncOriginal(); @@ -441,7 +441,7 @@ public function test_doesnt_invalidates_cache_if_cache_disabled(): void public function test_can_invalidate_cache_if_enabled(): void { - config()->set('laraconfig.cache.enable', true); + config()->set('multiconfig.cache.enable', true); $cache = $this->mock(Repository::class); @@ -451,14 +451,14 @@ public function test_can_invalidate_cache_if_enabled(): void ->andReturn($cache); $cache->shouldReceive('get') - ->with('laraconfig|'.DummyModel::class.'|1') + ->with('multiconfig|'.DummyModel::class.'|1') ->andReturnNull(); $cache->shouldReceive('forget') - ->with('laraconfig|'.DummyModel::class.'|1'); + ->with('multiconfig|'.DummyModel::class.'|1'); $cache->shouldReceive('forget') - ->with('laraconfig|'.DummyModel::class.'|1:time'); + ->with('multiconfig|'.DummyModel::class.'|1:time'); $cache->shouldNotReceive('setMultiple'); @@ -478,7 +478,7 @@ public function test_doesnt_regenerates_cache_if_cache_disabled(): void public function test_should_regenerate_cache_if_cache_enabled(): void { - config()->set('laraconfig.cache.enable', true); + config()->set('multiconfig.cache.enable', true); $cache = $this->mock(Repository::class); @@ -488,26 +488,26 @@ public function test_should_regenerate_cache_if_cache_enabled(): void ->andReturn($cache); $cache->shouldReceive('forget') - ->with('laraconfig|'.DummyModel::class.'|1'); + ->with('multiconfig|'.DummyModel::class.'|1'); $cache->shouldReceive('get') - ->with('laraconfig|'.DummyModel::class.'|1') + ->with('multiconfig|'.DummyModel::class.'|1') ->andReturn(new SettingsCollection([(new Setting())->forceFill([ 'name' => 'foo', ])])); $cache->shouldReceive('get') - ->with('laraconfig|'.DummyModel::class.'|1:time') + ->with('multiconfig|'.DummyModel::class.'|1:time') ->andReturn(now()->subMinute()); $cache->shouldReceive('set') - ->with('laraconfig|'.DummyModel::class.'|1', Mockery::type(Collection::class), 60 * 60 * 3) + ->with('multiconfig|'.DummyModel::class.'|1', Mockery::type(Collection::class), 60 * 60 * 3) ->andReturns(); $cache->shouldReceive('setMultiple') ->withArgs(function ($array, $ttl) { - static::assertArrayHasKey('laraconfig|'.DummyModel::class.'|1', $array); - static::assertArrayHasKey('laraconfig|'.DummyModel::class.'|1:time', $array); + static::assertArrayHasKey('multiconfig|'.DummyModel::class.'|1', $array); + static::assertArrayHasKey('multiconfig|'.DummyModel::class.'|1:time', $array); static::assertEquals(60 * 60 * 3, $ttl); return true; }) @@ -522,7 +522,7 @@ public function test_should_regenerate_cache_if_cache_enabled(): void public function test_should_not_regenerate_cache_if_is_not_fresher(): void { - config()->set('laraconfig.cache.enable', true); + config()->set('multiconfig.cache.enable', true); $cache = $this->mock(Repository::class); @@ -532,16 +532,16 @@ public function test_should_not_regenerate_cache_if_is_not_fresher(): void ->andReturn($cache); $cache->shouldReceive('forget') - ->with('laraconfig|'.DummyModel::class.'|1'); + ->with('multiconfig|'.DummyModel::class.'|1'); $cache->shouldReceive('get') - ->with('laraconfig|'.DummyModel::class.'|1') + ->with('multiconfig|'.DummyModel::class.'|1') ->andReturn(new SettingsCollection([(new Setting())->forceFill([ 'name' => 'foo', ])])); $cache->shouldReceive('get') - ->with('laraconfig|'.DummyModel::class.'|1:time') + ->with('multiconfig|'.DummyModel::class.'|1:time') ->andReturn(now()->addMinute()); $cache->shouldNotReceive('set'); @@ -566,7 +566,7 @@ public function test_doesnt_invalidates_cache_on_save_if_cache_disabled(): void public function test_invalidates_cache_only_once_on_set_if_cache_enabled(): void { - config()->set('laraconfig.cache.enable', true); + config()->set('multiconfig.cache.enable', true); $cache = $this->mock(Repository::class); @@ -577,27 +577,27 @@ public function test_invalidates_cache_only_once_on_set_if_cache_enabled(): void ->andReturn($cache); $cache->shouldReceive('get') - ->with('laraconfig|'.DummyModel::class.'|1') + ->with('multiconfig|'.DummyModel::class.'|1') ->once() ->andReturnNull(); $cache->shouldReceive('forget') - ->with('laraconfig|'.DummyModel::class.'|1') + ->with('multiconfig|'.DummyModel::class.'|1') ->once(); $cache->shouldReceive('forget') - ->with('laraconfig|'.DummyModel::class.'|1:time') + ->with('multiconfig|'.DummyModel::class.'|1:time') ->once(); $cache->shouldReceive('get') - ->with('laraconfig|'.DummyModel::class.'|1:time') + ->with('multiconfig|'.DummyModel::class.'|1:time') ->once() ->andReturnNull(); $cache->shouldReceive('setMultiple') ->withArgs(function ($array, $ttl) { - static::assertArrayHasKey('laraconfig|'.DummyModel::class.'|1', $array); - static::assertArrayHasKey('laraconfig|'.DummyModel::class.'|1:time', $array); + static::assertArrayHasKey('multiconfig|'.DummyModel::class.'|1', $array); + static::assertArrayHasKey('multiconfig|'.DummyModel::class.'|1:time', $array); static::assertEquals(60 * 60 * 3, $ttl); return true; }) @@ -619,7 +619,7 @@ public function test_invalidates_cache_only_once_on_set_if_cache_enabled(): void public function test_invalidates_cache_only_once_on_disable_if_cache_enabled(): void { - config()->set('laraconfig.cache.enable', true); + config()->set('multiconfig.cache.enable', true); $cache = $this->mock(Repository::class); @@ -629,25 +629,25 @@ public function test_invalidates_cache_only_once_on_disable_if_cache_enabled(): ->andReturn($cache); $cache->shouldReceive('get') - ->with('laraconfig|'.DummyModel::class.'|1') + ->with('multiconfig|'.DummyModel::class.'|1') ->once(); $cache->shouldReceive('forget') - ->with('laraconfig|'.DummyModel::class.'|1') + ->with('multiconfig|'.DummyModel::class.'|1') ->once(); $cache->shouldReceive('forget') - ->with('laraconfig|'.DummyModel::class.'|1:time') + ->with('multiconfig|'.DummyModel::class.'|1:time') ->once(); $cache->shouldReceive('get') - ->with('laraconfig|'.DummyModel::class.'|1:time') + ->with('multiconfig|'.DummyModel::class.'|1:time') ->once(); $cache->shouldReceive('setMultiple') ->withArgs(function ($array, $ttl) { - static::assertArrayHasKey('laraconfig|'.DummyModel::class.'|1', $array); - static::assertArrayHasKey('laraconfig|'.DummyModel::class.'|1:time', $array); + static::assertArrayHasKey('multiconfig|'.DummyModel::class.'|1', $array); + static::assertArrayHasKey('multiconfig|'.DummyModel::class.'|1:time', $array); static::assertEquals(60 * 60 * 3, $ttl); return true; }) @@ -669,10 +669,10 @@ public function test_invalidates_cache_only_once_on_disable_if_cache_enabled(): public function test_saves_and_retrieves_settings_from_cache(): void { - Cache::store('file')->forget('laraconfig|'.DummyModel::class.'|1'); + Cache::store('file')->forget('multiconfig|'.DummyModel::class.'|1'); - config()->set('laraconfig.cache.enable', true); - config()->set('laraconfig.cache.store', 'file'); + config()->set('multiconfig.cache.enable', true); + config()->set('multiconfig.cache.store', 'file'); $user = DummyModel::find(1); @@ -682,11 +682,11 @@ public function test_saves_and_retrieves_settings_from_cache(): void $user->settings->regenerate(true); - $settings = Cache::store('file')->get('laraconfig|'.DummyModel::class.'|1'); + $settings = Cache::store('file')->get('multiconfig|'.DummyModel::class.'|1'); $setting = $settings->firstWhere('name', 'foo'); - static::assertNull($setting->laraconfig); + static::assertNull($setting->multiconfig); static::assertSame('quz', $setting->value); } @@ -789,8 +789,8 @@ public function filterBags(): array public function test_cache_avoids_data_races(): void { - config()->set('laraconfig.cache.enable', true); - config()->set('laraconfig.cache.automatic', false); + config()->set('multiconfig.cache.enable', true); + config()->set('multiconfig.cache.automatic', false); $user_alpha = DummyModel::find(1); @@ -804,7 +804,7 @@ public function test_cache_avoids_data_races(): void $user_alpha->settings->regenerate(); - static::assertEquals('qux', cache()->get('laraconfig|'.DummyModel::class.'|1')->get('foo')->value); + static::assertEquals('qux', cache()->get('multiconfig|'.DummyModel::class.'|1')->get('foo')->value); } public function test_checks_settings_has_key(): void diff --git a/tests/Migrator/Pipes/FindModelsWithSettingsTest.php b/tests/Migrator/Pipes/FindModelsWithSettingsTest.php index 970455d..faf93c1 100644 --- a/tests/Migrator/Pipes/FindModelsWithSettingsTest.php +++ b/tests/Migrator/Pipes/FindModelsWithSettingsTest.php @@ -2,8 +2,8 @@ namespace Tests\Migrator\Pipes; -use DarkGhostHunter\Laraconfig\Migrator\Data; -use DarkGhostHunter\Laraconfig\Migrator\Pipes\FindModelsWithSettings; +use SynergiTech\Multiconfig\Migrator\Data; +use SynergiTech\Multiconfig\Migrator\Pipes\FindModelsWithSettings; use Illuminate\Database\Eloquent\Model; use Illuminate\Filesystem\Filesystem; use Illuminate\Support\Str; @@ -28,7 +28,7 @@ protected function setUp(): void namespace App; -use DarkGhostHunter\Laraconfig\HasConfig; +use SynergiTech\Multiconfig\HasConfig; use Illuminate\Database\Eloquent\Model; class Quz extends Model @@ -56,7 +56,7 @@ class Qux extends Model namespace App; -use DarkGhostHunter\Laraconfig\HasConfig; +use SynergiTech\Multiconfig\HasConfig; trait TraitOfTrait { @@ -133,7 +133,7 @@ public function test_reads_models_in_model_dir(): void namespace App\Models; -use DarkGhostHunter\Laraconfig\HasConfig; +use SynergiTech\Multiconfig\HasConfig; use Illuminate\Database\Eloquent\Model; class Foo extends Model @@ -172,7 +172,7 @@ trait HasConfig namespace App; -use DarkGhostHunter\Laraconfig\HasConfig; +use SynergiTech\Multiconfig\HasConfig; class NormalClass { diff --git a/tests/RegistersPackage.php b/tests/RegistersPackage.php index d240b3b..7bdf21b 100644 --- a/tests/RegistersPackage.php +++ b/tests/RegistersPackage.php @@ -2,8 +2,8 @@ namespace Tests; -use DarkGhostHunter\Laraconfig\LaraconfigServiceProvider; -use DarkGhostHunter\Laraconfig\Facades\Setting; +use SynergiTech\Multiconfig\MulticonfigServiceProvider; +use SynergiTech\Multiconfig\Facades\Setting; trait RegistersPackage { @@ -17,7 +17,7 @@ trait RegistersPackage protected function getPackageProviders($app): array { return [ - LaraconfigServiceProvider::class, + MulticonfigServiceProvider::class, ]; } @@ -34,4 +34,4 @@ protected function getPackageAliases($app) 'Setting' => Setting::class, ]; } -} \ No newline at end of file +} diff --git a/tests/Registrar/RegistrarTest.php b/tests/Registrar/RegistrarTest.php index ddaf713..6f177e4 100644 --- a/tests/Registrar/RegistrarTest.php +++ b/tests/Registrar/RegistrarTest.php @@ -2,8 +2,8 @@ namespace Tests\Registrar; -use DarkGhostHunter\Laraconfig\Facades\Setting; -use DarkGhostHunter\Laraconfig\Registrar\SettingRegistrar; +use SynergiTech\Multiconfig\Facades\Setting; +use SynergiTech\Multiconfig\Registrar\SettingRegistrar; use Illuminate\Support\Collection; use Tests\BaseTestCase; @@ -106,4 +106,4 @@ public function test_registers_migrable_with_procedure(): void static::assertEquals('baz', $this->registrar->getMigrable()->get('foo')->from); static::assertEquals(fn() => true, $this->registrar->getMigrable()->get('foo')->using); } -} \ No newline at end of file +} diff --git a/tests/ServiceProviderTest.php b/tests/ServiceProviderTest.php index f9ed988..eca7566 100644 --- a/tests/ServiceProviderTest.php +++ b/tests/ServiceProviderTest.php @@ -2,9 +2,9 @@ namespace Tests; -use DarkGhostHunter\Laraconfig\Facades\Setting; -use DarkGhostHunter\Laraconfig\LaraconfigServiceProvider; -use DarkGhostHunter\Laraconfig\Registrar\SettingRegistrar; +use SynergiTech\Multiconfig\Facades\Setting; +use SynergiTech\Multiconfig\MulticonfigServiceProvider; +use SynergiTech\Multiconfig\Registrar\SettingRegistrar; use Illuminate\Filesystem\Filesystem; use Illuminate\Support\Str; use SplFileInfo; @@ -23,7 +23,7 @@ protected function setUp(): void public function test_registers_package(): void { - static::assertArrayHasKey(LaraconfigServiceProvider::class, $this->app->getLoadedProviders()); + static::assertArrayHasKey(MulticonfigServiceProvider::class, $this->app->getLoadedProviders()); } public function test_facades(): void @@ -33,7 +33,7 @@ public function test_facades(): void public function test_uses_config(): void { - static::assertEquals(include(__DIR__.'/../config/laraconfig.php'), config('laraconfig')); + static::assertEquals(include(__DIR__.'/../config/multiconfig.php'), config('multiconfig')); } public function test_publishes_config(): void @@ -41,12 +41,12 @@ public function test_publishes_config(): void $this->artisan( 'vendor:publish', [ - '--provider' => 'DarkGhostHunter\Laraconfig\LaraconfigServiceProvider', + '--provider' => 'SynergiTech\Multiconfig\MulticonfigServiceProvider', '--tag' => 'config', ] )->execute(); - static::assertFileEquals(base_path('config/laraconfig.php'), __DIR__ . '/../config/laraconfig.php'); + static::assertFileEquals(base_path('config/multiconfig.php'), __DIR__ . '/../config/multiconfig.php'); } public function test_publishes_migrations(): void @@ -56,7 +56,7 @@ public function test_publishes_migrations(): void $this->artisan( 'vendor:publish', [ - '--provider' => 'DarkGhostHunter\Laraconfig\LaraconfigServiceProvider', + '--provider' => 'SynergiTech\Multiconfig\MulticonfigServiceProvider', '--tag' => 'migrations', ] )->run(); @@ -78,7 +78,7 @@ static function (SplFileInfo $file): bool { protected function tearDown(): void { - $this->filesystem->delete(base_path('config/laraconfig.php')); + $this->filesystem->delete(base_path('config/multiconfig.php')); $this->filesystem->cleanDirectory(database_path('migrations')); parent::tearDown();