| 12345678910111213141516171819202122232425262728 |
- <?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')->unique(); // ключ страницы: home, services, contacts
- $table->string('title'); // заголовок страницы
- $table->longText('content')->nullable(); // HTML-контент (основное тело)
- $table->string('meta_title')->nullable();
- $table->text('meta_description')->nullable();
- $table->boolean('is_active')->default(true);
- $table->timestamps();
- });
- }
- public function down(): void
- {
- Schema::dropIfExists('pages');
- }
- };
|