Migration.stub 706 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. return new class extends Migration
  6. {
  7. public function up(): void
  8. {
  9. Schema::create('{{tableNameSnakeCase}}', function (Blueprint $table) {
  10. $table->id();
  11. // $table->string('field');
  12. // Add your columns here
  13. $table->timestamps();
  14. $table->softDeletes(); // Optional: for soft deletes
  15. // Indexes, remember they are important
  16. // $table->index('field');
  17. });
  18. }
  19. public function down(): void
  20. {
  21. Schema::dropIfExists('{{tableNameSnakeCase}}');
  22. }
  23. };