Column Types

Migrations are generated with appropriate column types:

public function up(): void
{
    Schema::create('posts', function (Blueprint $table) {
        // Primary Key
        $table->id('id');
        
        // Fields
        $table->string('title');
        $table->text('content')->nullable();
        $table->enum('status', ['draft', 'published', 'archived']);
        $table->integer('view_count')->default(0);
        $table->dateTime('published_at')->nullable();
        
        // Timestamps
        $table->timestamps();
        
        // Soft Deletes
        $table->softDeletes();
    });
}

Last updated