/ database / migrations / 2023_05_31_110026_create_internal_notes_table.php
2023_05_31_110026_create_internal_notes_table.php
 1  <?php
 2  
 3  use Illuminate\Database\Migrations\Migration;
 4  use Illuminate\Database\Schema\Blueprint;
 5  use Illuminate\Support\Facades\Schema;
 6  
 7  return new class extends Migration {
 8      public function up(): void
 9      {
10          Schema::create('internal_notes', function (Blueprint $table) {
11              $table->id();
12              $table->longText('text');
13              $table->foreignIdFor(\App\Models\User::class)->nullable()->constrained()->nullOnDelete();
14              $table->morphs('internal_noteable');
15              $table->timestamps();
16          });
17      }
18  
19      public function down(): void
20      {
21          Schema::dropIfExists('internal_notes');
22      }
23  };