diff --git a/app/Livewire/Settings/Synapse.php b/app/Livewire/Settings/Synapse.php
new file mode 100644
index 0000000..a481e62
--- /dev/null
+++ b/app/Livewire/Settings/Synapse.php
@@ -0,0 +1,33 @@
+synapseEndpoint = Settings::get('synapse_endpoint', '');
+ $this->synapseAccessToken = Settings::get('synapse_access_token', '');
+ }
+
+ public function save(): void
+ {
+ Settings::set('synapse_endpoint', $this->synapseEndpoint);
+ Settings::set('synapse_access_token', $this->synapseAccessToken);
+ }
+
+ public function render()
+ {
+ return view('livewire.settings.synapse');
+ }
+}
diff --git a/app/Models/Settings.php b/app/Models/Settings.php
new file mode 100644
index 0000000..da42806
--- /dev/null
+++ b/app/Models/Settings.php
@@ -0,0 +1,23 @@
+value('value') ?? $default;
+ }
+
+ public static function set($key, $value)
+ {
+ return static::updateOrCreate(['key' => $key], ['value' => $value]);
+ }
+}
diff --git a/app/Services/SynapseService.php b/app/Services/SynapseService.php
index 0dde34b..c15bdf7 100644
--- a/app/Services/SynapseService.php
+++ b/app/Services/SynapseService.php
@@ -2,6 +2,8 @@
namespace App\Services;
+use App\Models\Settings;
+
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
@@ -9,8 +11,8 @@ class SynapseService
{
public function createRegistrationToken(): ?string
{
- $token = config('synapse.admin_api_token');
- $endpoint = config('synapse.admin_api_url');
+ $token = Settings::get('synapse_access_token', '');
+ $endpoint = Settings::get('synapse_endpoint', '');
$response = Http::withHeaders([
'Authorization' => "Bearer $token",
diff --git a/config/synapse.php b/config/synapse.php
deleted file mode 100644
index fd4ba6b..0000000
--- a/config/synapse.php
+++ /dev/null
@@ -1,27 +0,0 @@
- env('SYNAPSE_ADMIN_API_TOKEN'),
-
- /*
- |--------------------------------------------------------------------------
- | Admin API Endpoint
- |--------------------------------------------------------------------------
- |
- | This variable contains the admin endpoint for synapse.
- |
- */
-
- 'admin_api_url' => env('SYNAPSE_ADMIN_API_URL'),
-
-];
diff --git a/database/migrations/2025_05_03_092111_create_settings_table.php b/database/migrations/2025_05_03_092111_create_settings_table.php
new file mode 100644
index 0000000..2ae121f
--- /dev/null
+++ b/database/migrations/2025_05_03_092111_create_settings_table.php
@@ -0,0 +1,29 @@
+id();
+ $table->string('key')->unique();
+ $table->string('value');
+ $table->timestamps();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::dropIfExists('settings');
+ }
+};
diff --git a/resources/views/components/layouts/app/sidebar.blade.php b/resources/views/components/layouts/app/sidebar.blade.php
index 781550e..4583fb8 100644
--- a/resources/views/components/layouts/app/sidebar.blade.php
+++ b/resources/views/components/layouts/app/sidebar.blade.php
@@ -10,6 +10,7 @@