Laravel Shopping Cart Tutorial| Add to Cart

This commit is contained in:
UronShrestha
2024-07-04 17:52:47 +05:45
parent f14a8026b5
commit 080094d2dd
5 changed files with 254 additions and 187 deletions

View File

@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('carts', function (Blueprint $table) {
$table->id();
$table->integer('productId')->default(0);
$table->integer('customerId')->default(0);
$table->integer('quantity')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('carts');
}
};