feat: add system configuration (A-03) — map center, zoom, radius min/max
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('settings', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('key')->unique();
|
||||
$table->string('value');
|
||||
$table->string('label');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
// Default values
|
||||
$defaults = [
|
||||
['key' => 'map_center_lat', 'value' => '-0.0553', 'label' => 'Pusat Peta — Latitude'],
|
||||
['key' => 'map_center_lng', 'value' => '109.3463', 'label' => 'Pusat Peta — Longitude'],
|
||||
['key' => 'map_default_zoom', 'value' => '17', 'label' => 'Zoom Default Peta'],
|
||||
['key' => 'radius_min', 'value' => '50', 'label' => 'Radius Minimum (meter)'],
|
||||
['key' => 'radius_max', 'value' => '2000', 'label' => 'Radius Maksimum (meter)'],
|
||||
];
|
||||
|
||||
foreach ($defaults as $row) {
|
||||
\DB::table('settings')->insert(array_merge($row, [
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('settings');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user