- do not hardcode IDs as this is bad practice. - Use update or create to allow the seeder to be run multiple times.
31 lines
558 B
PHP
31 lines
558 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\OauthSetting;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class OauthSettingSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
$providers = [
|
|
'azure',
|
|
'bitbucket',
|
|
'github',
|
|
'gitlab',
|
|
'google',
|
|
'authentik',
|
|
];
|
|
|
|
foreach ($providers as $provider) {
|
|
OauthSetting::updateOrCreate(
|
|
['provider' => $provider]
|
|
);
|
|
}
|
|
}
|
|
}
|