Initial commit

This commit is contained in:
root
2026-05-09 17:28:23 +02:00
commit 9d73f82529
5575 changed files with 281989 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
<?php
namespace Database\Seeders;
use App\Models\Miscellaneous\WebsiteSetting;
use Illuminate\Database\Seeder;
abstract class BaseSettingsSeeder extends Seeder
{
/**
* Get the settings array to be seeded.
* Override this in child classes.
*/
abstract protected function getSettings(): array;
/**
* Run the database seeds.
*/
public function run(): void
{
foreach ($this->getSettings() as $setting) {
WebsiteSetting::firstOrCreate(
['key' => $setting['key']],
[
'key' => $setting['key'],
'value' => $setting['value'],
'comment' => $setting['comment'] ?? null,
],
);
}
}
/**
* Create a setting array with common structure.
*/
protected function setting(string $key, string $value, string $comment = ''): array
{
return [
'key' => $key,
'value' => $value,
'comment' => $comment,
];
}
}