Schema::create('posts', function (Blueprint $table) { $table->id(); $table->foreignId('author')->constrained('users')->onDelete('cascade')->onUpdate('cascade'); $table->timestamps(); });