for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCartItemsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
Schema::create('cart_items', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('cart_id');
$table->foreign('cart_id')
->references('id')
->on('carts');
$table->morphs('buyable');
$table->unsignedInteger('quantity');
$table->json('options')->nullable();
$table->timestamps();
});
}
* Reverse the migrations.
public function down()
Schema::dropIfExists('cart_items');