How to add a virtual column with the schema builder?
问题 I'm creating a table like this, Schema::create('booking_segments', function (Blueprint $table) { $table->increments('id'); $table->datetime('start')->index(); $table->integer('duration')->unsigned(); $table->string('comments'); $table->integer('booking_id')->unsigned(); $table->foreign('booking_id')->references('id')->on('bookings')->onDelete('cascade'); }); But I want to add one extra column. It looks like this in raw SQL: ALTER TABLE booking_segments ADD COLUMN `end` DATETIME AS (DATE_ADD(