bigIncrements('id'); $table->string('external_id'); $table->unsignedBigInteger('team_id')->index()->nullable(); $table->morphs('clientable'); $table->unsignedBigInteger('user_created_id')->nullable(); $table->foreign('user_created_id')->references('id')->on('users'); $table->unsignedBigInteger('user_updated_id')->nullable(); $table->foreign('user_updated_id')->references('id')->on('users'); $table->unsignedBigInteger('user_deleted_id')->nullable(); $table->foreign('user_deleted_id')->references('id')->on('users'); $table->unsignedBigInteger('user_restored_id')->nullable(); $table->foreign('user_restored_id')->references('id')->on('users'); $table->unsignedBigInteger('user_owner_id')->nullable(); $table->foreign('user_owner_id')->references('id')->on('users'); $table->unsignedBigInteger('user_assigned_id')->nullable(); $table->foreign('user_assigned_id')->references('id')->on('users'); $table->timestamps(); $table->softDeletes(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists(config('laravel-crm.db_table_prefix').'clients'); } }