Skip to content

Commit 1a42fda

Browse files
Fix test and PHPStan
1 parent c60f347 commit 1a42fda

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

phpstan-baseline.neon

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ parameters:
1010
count: 1
1111
path: src/Models/SettingsProperty.php
1212

13+
-
14+
message: "#^Property 'payload' does not exist in Spatie\\\\LaravelSettings\\\\Models\\\\SettingsProperty model\\.$#"
15+
count: 1
16+
path: src/Models/SettingsProperty.php
17+
1318
-
1419
message: "#^Call to method toArray\\(\\) on an unknown class Spatie\\\\DataTransferObject\\\\DataTransferObject\\.$#"
1520
count: 1

src/LaravelSettingsServiceProvider.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace Spatie\LaravelSettings;
44

55
use Illuminate\Database\Events\SchemaLoaded;
6+
use Illuminate\Database\Migrations\MigrationRepositoryInterface;
7+
use Illuminate\Database\Migrations\Migrator;
68
use Illuminate\Support\Facades\Event;
79
use Illuminate\Support\ServiceProvider;
810
use Spatie\LaravelSettings\Console\CacheDiscoveredSettingsCommand;
@@ -99,8 +101,12 @@ private function removeMigrationsWhenSchemaLoaded(SchemaLoaded $event)
99101
->filter()
100102
->values();
101103

104+
$migrationsConfig = config()->get('database.migrations');
105+
106+
$migrationsTable = is_array($migrationsConfig) ? ($migrationsConfig['table'] ?? null) : $migrationsConfig;
107+
102108
$event->connection
103-
->table(config()->get('database.migrations'))
109+
->table($migrationsTable)
104110
->useWritePdo()
105111
->whereIn('migration', $migrations)
106112
->delete();

0 commit comments

Comments
 (0)