id(); $table->string('title'); $table->text('body'); $table->text('excerpt'); // توضیحات مختصر $table->string('slug')->unique(); $table->unsignedBigInteger('author_id'); // نویسنده $table->foreign('author_id')->references('id')->on('users')->onDelete('cascade'); $table->unsignedBigInteger('category_id'); // دسته بندی $table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade'); $table->string('featured_image')->nullable(); // تصویر شاخص $table->integer('views')->default(0); // تعداد بازدید $table->integer('likes')->default(0); // تعداد لایک $table->timestamp('published_at')->nullable(); // تاریخ انتشار $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('posts'); } };