id(); $table->foreignId('company_id')->constrained()->cascadeOnDelete(); $table->string('name')->index(); $table->string('description')->nullable(); $table->integer('rate')->default(0); $table->string('computation')->default(TaxComputation::DEFAULT); $table->string('type')->default(TaxType::DEFAULT); $table->string('scope')->nullable(); $table->boolean('enabled')->default(true); $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete(); $table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete(); $table->timestamps(); $table->unique(['company_id', 'name', 'type']); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('taxes'); } };