2026_05_06_173123_create_pages_table.php 1.0 KB

12345678910111213141516171819202122232425262728
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. // Таблица статических страниц сайта (главная, услуги, контакты)
  6. return new class extends Migration
  7. {
  8. public function up(): void
  9. {
  10. Schema::create('pages', function (Blueprint $table) {
  11. $table->id();
  12. $table->string('slug')->unique(); // ключ страницы: home, services, contacts
  13. $table->string('title'); // заголовок страницы
  14. $table->longText('content')->nullable(); // HTML-контент (основное тело)
  15. $table->string('meta_title')->nullable();
  16. $table->text('meta_description')->nullable();
  17. $table->boolean('is_active')->default(true);
  18. $table->timestamps();
  19. });
  20. }
  21. public function down(): void
  22. {
  23. Schema::dropIfExists('pages');
  24. }
  25. };