feat: Add FAQs field to Country model and update form for extra FAQs input

This commit is contained in:
2025-08-21 12:28:07 +05:45
parent 9b45e88f27
commit d15949d9c2
4 changed files with 38 additions and 109 deletions

View File

@@ -23,6 +23,7 @@ class Country extends Model
'slug',
'short_description',
'description',
'faqs',
'image',
'parent_id',
'images',
@@ -104,5 +105,4 @@ class Country extends Model
{
return $this->morphMany(Document::class, 'documentable');
}
}

View File

@@ -0,0 +1,28 @@
<?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('countries', function (Blueprint $table) {
$table->longText('faqs')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('countries', function (Blueprint $table) {
$table->dropColumn('faqs');
});
}
};

View File

@@ -19,6 +19,11 @@
{{ html()->span('*')->class('text-danger') }}
{{ html()->textarea('description')->class('form-control ckeditor-classic')->placeholder('Enter Country Description')->required() }}
</div>
<div class="col-12">
{{ html()->label('Extra FAQs')->class('form-label')->for('faqs') }}
{{ html()->textarea('faqs')->class('form-control ckeditor-classic')->placeholder('Enter Extra FAQs')->required() }}
</div>
</div>
</div>
</div>
@@ -87,13 +92,11 @@
<div class="card-body">
<div class="mb-3">
{{ html()->label('Featured')->class('form-label')->for('image') }}
<x-image-input :data="$editable ? $country->getRawOriginal('image') : null" id="image" name="image" :editable="$editable"
:multiple=false />
<x-image-input :data="$editable ? $country->getRawOriginal('image') : null" id="image" name="image" :editable="$editable" :multiple=false />
</div>
{{ html()->label('Banner')->class('form-label')->for('banner') }}
<x-image-input :data="$editable ? $country->getRawOriginal('banner') : null" id="banner" name="banner" :editable="$editable"
:multiple=false />
<x-image-input :data="$editable ? $country->getRawOriginal('banner') : null" id="banner" name="banner" :editable="$editable" :multiple=false />
</div>
</div>