Add Site Translation Management: Created SiteTranslation resource with pages for listing, creating, and editing translations. Implemented localization support for translation keys and values, enhancing the admin panel's usability for managing site translations. Introduced a new migration for the site_translations table and updated helper functions for translation retrieval.

This commit is contained in:
Ümit Tunç
2025-12-30 23:41:32 +03:00
parent f381caaa39
commit 064ec327ba
13 changed files with 376 additions and 252 deletions
@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('site_translations', function (Blueprint $table) {
$table->id();
$table->string('hash')->unique()->index(); // MD5 hash of the key
$table->text('key'); // Original text
$table->json('translations')->nullable(); // JSON data: {"en": "...", "tr": "..."}
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('site_translations');
}
};