foreignId('company_id')->unsigned(); $table->foreignId('user_id')->unsigned(); $table->integer('status')->default(ApprovalStatus::APPROVED); $table->primary(['company_id', 'user_id']); $table->foreign('user_id')->references('id')->on('users'); $table->foreign('company_id')->references('id')->on('companies'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('company_employee'); } }