laravelEcomm/database/migrations/2024_07_03_081708_create_products_table.php

37 lines
806 B
PHP
Raw Permalink Normal View History

2024-07-04 04:34:45 +00:00
<?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('products', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('picture');
$table->string('description');
$table->float('price');
$table->integer('quantity');
$table->string('category');
$table->string('type');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('products');
}
};