ferdysetia_aan

TK4 - No.1 - /migrations/2025_08_03_000001_create_categories_table.php

Aug 3rd, 2025
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. // database/migrations/2025_08_03_000001_create_categories_table.php
  2.  
  3. use Illuminate\Database\Migrations\Migration;
  4. use Illuminate\Database\Schema\Blueprint;
  5. use Illuminate\Support\Facades\Schema;
  6.  
  7. class CreateCategoriesTable extends Migration
  8. {
  9.     public function up()
  10.     {
  11.         Schema::create('categories', function (Blueprint $table) {
  12.             $table->id();
  13.             $table->string('name')->unique();
  14.             $table->timestamps();
  15.         });
  16.     }
  17.  
  18.     public function down()
  19.     {
  20.         Schema::dropIfExists('categories');
  21.     }
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment