fix: improve OauthSettingSeeder to correctly delete non-existent providers and ensure proper handling of provider definitions

This commit is contained in:
Andras Bacsai
2024-12-13 09:31:35 +01:00
parent a80d17e097
commit a53a1349e3

View File

@@ -32,8 +32,10 @@ class OauthSettingSeeder extends Seeder
$allProviders = OauthSetting::all();
$notFoundProviders = $providers->diff($allProviders->pluck('provider'));
$allProviders->each(function ($provider) use ($providers) {
$allProviders->each(function ($provider) {
$provider->delete();
});
$allProviders->each(function ($provider) use ($providers) {
$providerName = $provider->provider;
$foundProvider = $providers->first(function ($provider) use ($providerName) {