id(); $table->foreignId('customer_job_id')->constrained()->restrictOnDelete(); $table->foreignId('user_id')->constrained()->restrictOnDelete(); $table->foreignId('recorded_by')->constrained('users')->restrictOnDelete(); $table->string('category', 20); $table->string('paid_by', 20); $table->date('spent_on'); $table->string('description', 255)->nullable(); $table->unsignedInteger('cost_cents'); $table->decimal('kilometers', 7, 1)->nullable(); $table->string('destination', 255)->nullable(); $table->string('purpose', 255)->nullable(); $table->boolean('is_billable')->default(true); $table->unsignedInteger('markup_basis_points')->nullable(); $table->unsignedInteger('billed_amount_cents')->nullable(); $table->timestamps(); $table->index(['customer_job_id', 'spent_on']); $table->index(['user_id', 'spent_on']); }); } public function down(): void { Schema::dropIfExists('expenses'); } };