From 0e00872ff92bb75fceac45181d5a48dace928fdf Mon Sep 17 00:00:00 2001 From: Rudolf Bruder Date: Tue, 28 Dec 2021 09:53:07 +0100 Subject: [PATCH 1/7] Modification needed for working package --- src/Migrator/Pipes/CreateNewMetadata.php | 3 ++- src/Migrator/Pipes/FindModelsWithSettings.php | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Migrator/Pipes/CreateNewMetadata.php b/src/Migrator/Pipes/CreateNewMetadata.php index ee647ad..f72ec78 100644 --- a/src/Migrator/Pipes/CreateNewMetadata.php +++ b/src/Migrator/Pipes/CreateNewMetadata.php @@ -144,13 +144,14 @@ protected function fillSettings(Metadata $metadata, Collection $models): int // simply inserting them by each user. We will also point the ID of // both the Metadata parent and user, along with the default value. foreach ($models as $model) { + $morphClass = str_replace('\\', '\\\\', $model->getMorphClass()); $affected += Setting::query()->insertUsing( ['metadata_id', 'settable_id', 'settable_type', 'value', 'created_at', 'updated_at'], $model->newQuery() ->select([ DB::raw("'{$metadata->getKey()}' as metadata_id"), DB::raw("{$model->getKeyName()} as settable_id"), - DB::raw("'{$model->getMorphClass()}' as settable_type"), + DB::raw("'{$morphClass}' as settable_type"), DB::raw("'{$metadata->getRawOriginal('default', 'NULL')}' as value"), DB::raw("'{$this->now->toDateTimeString()}' as created_at"), DB::raw("'{$this->now->toDateTimeString()}' as updated_at"), diff --git a/src/Migrator/Pipes/FindModelsWithSettings.php b/src/Migrator/Pipes/FindModelsWithSettings.php index 4a6ae83..314e742 100644 --- a/src/Migrator/Pipes/FindModelsWithSettings.php +++ b/src/Migrator/Pipes/FindModelsWithSettings.php @@ -80,14 +80,14 @@ protected function findModelsWithSettings(): Generator foreach ($files as $file) { $className = (string) Str::of($file->getPathname()) - ->after($this->app->basePath()) - ->trim('\\') - ->trim('/') - ->ltrim('app\\') - ->rtrim('.php') - ->replace(DIRECTORY_SEPARATOR, '\\') - ->ltrim('\\') - ->start('\\'.$namespace); + ->after($this->app->basePath()) + ->trim('\\') + ->trim('/') + ->ltrim('app\\') + ->replace('.php', '') + ->replace(DIRECTORY_SEPARATOR, '\\') + ->start('\\' . $namespace) + ->replace('\\\\', '\\'); try { $reflection = new ReflectionClass($className); From 6df2072833d9460cc10ede4112080f1d79f6027a Mon Sep 17 00:00:00 2001 From: Rudolf Bruder Date: Wed, 23 Feb 2022 09:22:17 +0100 Subject: [PATCH 2/7] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d4830a6..2ff4f06 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "require": { "php": ">=8.0", "illuminate/database": "^8.43", - "illuminate/support": "^8.43", + "illuminate/support": "^9.2", "illuminate/collections": "^8.43", "illuminate/config": "^8.43", "illuminate/cache": "^8.43", From eef5728498f6fad8d5a4a437222f00c6f9422cb9 Mon Sep 17 00:00:00 2001 From: Rudolf Bruder Date: Wed, 23 Feb 2022 09:23:18 +0100 Subject: [PATCH 3/7] Update composer.json --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 2ff4f06..34f891d 100644 --- a/composer.json +++ b/composer.json @@ -12,11 +12,11 @@ ], "require": { "php": ">=8.0", - "illuminate/database": "^8.43", + "illuminate/database": "^9.2", "illuminate/support": "^9.2", - "illuminate/collections": "^8.43", - "illuminate/config": "^8.43", - "illuminate/cache": "^8.43", + "illuminate/collections": "^9.2", + "illuminate/config": "^9.2", + "illuminate/cache": "^9.2", "symfony/console": "^5.3" }, "require-dev": { From 774777c41ed590c8c50c4e9b9d617388950a606c Mon Sep 17 00:00:00 2001 From: Rudolf Bruder Date: Wed, 23 Feb 2022 09:26:16 +0100 Subject: [PATCH 4/7] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 34f891d..0dcc39d 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "illuminate/collections": "^9.2", "illuminate/config": "^9.2", "illuminate/cache": "^9.2", - "symfony/console": "^5.3" + "symfony/console": "^6.0.3" }, "require-dev": { "mockery/mockery": "^1.4.3", From f87b82f29bf8d1432f9c0b0b67d4a49603542e25 Mon Sep 17 00:00:00 2001 From: Rudolf Bruder Date: Thu, 19 May 2022 09:25:38 +0200 Subject: [PATCH 5/7] Custom readme --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 90fb817..7cbfc17 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +This package has been archived. + +Sorry guys and gals, I bit more than I can chew and I'm currently not using this package to justify its support. + +I may revisit this in the near future. + --- ![Xavier von Erlach - Unsplash #ooR1jY2yFr4](https://images.unsplash.com/photo-1570221622224-3bb8f08f166c?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1200&h=400&q=80) From 348c08005763e031c817e8eb0657b19a1b6bb453 Mon Sep 17 00:00:00 2001 From: Rudolf Bruder Date: Thu, 19 May 2022 09:48:59 +0200 Subject: [PATCH 6/7] Removed string in argument --- src/SettingsCollection.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/SettingsCollection.php b/src/SettingsCollection.php index 51c438a..1c17fc1 100644 --- a/src/SettingsCollection.php +++ b/src/SettingsCollection.php @@ -53,12 +53,12 @@ public function groups(): static /** * Returns the value of a setting. * - * @param string $name + * @param $name * @param mixed|null $default * * @return \Illuminate\Support\Carbon|\Illuminate\Support\Collection|array|string|int|float|bool|null */ - public function value(string $name, mixed $default = null): Carbon|Collection|array|string|int|float|bool|null + public function value($name, mixed $default = null): Carbon|Collection|array|string|int|float|bool|null { $setting = $this->get($name, $default); @@ -99,7 +99,7 @@ public function set(string|array $name, mixed $value = null, bool $force = true) } foreach ($name as $key => $setting) { - if (! $instance = $this->get($key)) { + if (!$instance = $this->get($key)) { throw new RuntimeException("The setting [$key] doesn't exist."); } @@ -152,7 +152,7 @@ public function isEnabled(string $name): bool */ public function isDisabled(string $name): bool { - return ! $this->isEnabled($name); + return !$this->isEnabled($name); } /** @@ -229,7 +229,7 @@ public function except($keys): static { if ($keys instanceof Enumerable) { $keys = $keys->all(); - } elseif (! is_array($keys)) { + } elseif (!is_array($keys)) { $keys = func_get_args(); } @@ -325,4 +325,4 @@ public function __get($key): mixed return $this->__dynamicget($key); } -} +} \ No newline at end of file From a15978b083deacd11c034c850b89c82f19e1f098 Mon Sep 17 00:00:00 2001 From: Rudolf Bruder Date: Thu, 9 Nov 2023 10:47:55 +0100 Subject: [PATCH 7/7] Laravel 10 update --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 0dcc39d..fe547c5 100644 --- a/composer.json +++ b/composer.json @@ -12,11 +12,11 @@ ], "require": { "php": ">=8.0", - "illuminate/database": "^9.2", - "illuminate/support": "^9.2", - "illuminate/collections": "^9.2", - "illuminate/config": "^9.2", - "illuminate/cache": "^9.2", + "illuminate/database": "^10.2", + "illuminate/support": "^10.2", + "illuminate/collections": "^10.2", + "illuminate/config": "^10.2", + "illuminate/cache": "^10.2", "symfony/console": "^6.0.3" }, "require-dev": {