33 lines
994 B
PHP
33 lines
994 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
Schema::create('pages', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('slug', 191)->unique();
|
|
$table->string('title', 255);
|
|
$table->mediumText('body');
|
|
$table->string('layout', 50)->default('default'); // default | legal | help
|
|
$table->string('meta_title', 255)->nullable();
|
|
$table->text('meta_description')->nullable();
|
|
$table->boolean('is_published')->default(false);
|
|
$table->timestamp('published_at')->nullable();
|
|
$table->timestamps();
|
|
$table->softDeletes();
|
|
|
|
$table->index(['is_published', 'published_at']);
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('pages');
|
|
}
|
|
};
|