Add sections and data fields to Page model, create migration for sections column, and implement PageSeeder for initial page data: Enhanced the Page model with new fields for sections and data, added a migration to include a JSON column for sections in the pages table, and created a PageSeeder to populate the database with example pages including structured sections for content management.

This commit is contained in:
Ümit Tunç
2025-10-30 15:55:32 -03:00
parent 05eb3bf34a
commit 4a98a6d8f0
8 changed files with 664 additions and 263 deletions
@@ -0,0 +1,29 @@
<?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('pages', function (Blueprint $table) {
// JSON kolonu: Sayfa blokları (hero, features, pricing, cta vb.)
$table->json('sections')->nullable()->after('content');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('pages', function (Blueprint $table) {
$table->dropColumn('sections');
});
}
};