id(); $table->unsignedBigInteger('product_id'); $table->unsignedBigInteger('cart_id')->nullable(); $table->unsignedBigInteger('user_id')->nullable(); $table->float('price'); $table->integer('quantity'); $table->float('amount'); $table->foreign('product_id')->references('id')->on('products')->onDelete('CASCADE'); $table->foreign('user_id')->references('id')->on('users')->onDelete('SET NULL'); $table->foreign('cart_id')->references('id')->on('carts')->onDelete('SET NULL'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('wishlists'); } }