Implement default data functionality for templates: Added 'default_data' field to HeaderTemplate, FooterTemplate, and SectionTemplate models. Enhanced TemplateService to generate dynamic fields based on this new data. Updated form schemas in template forms to include sections for default values, improving template management and usability. Added localization support for new fields in both English and Turkish.
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?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::table('header_templates', function (Blueprint $table) {
|
||||
$table->json('default_data')->nullable()->after('html_content');
|
||||
});
|
||||
|
||||
Schema::table('footer_templates', function (Blueprint $table) {
|
||||
$table->json('default_data')->nullable()->after('html_content');
|
||||
});
|
||||
|
||||
Schema::table('section_templates', function (Blueprint $table) {
|
||||
$table->json('default_data')->nullable()->after('html_content');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('header_templates', function (Blueprint $table) {
|
||||
$table->dropColumn('default_data');
|
||||
});
|
||||
|
||||
Schema::table('footer_templates', function (Blueprint $table) {
|
||||
$table->dropColumn('default_data');
|
||||
});
|
||||
|
||||
Schema::table('section_templates', function (Blueprint $table) {
|
||||
$table->dropColumn('default_data');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user