id(); $table->foreignId('company_id')->constrained()->cascadeOnDelete(); $table->foreignId('account_id')->nullable()->constrained()->nullOnDelete(); $table->foreignId('bank_account_id')->nullable()->constrained()->nullOnDelete(); $table->foreignId('contact_id')->nullable()->constrained()->nullOnDelete(); $table->string('type'); // income, expense, other $table->string('method'); // deposit, withdrawal $table->string('payment_channel')->nullable(); // online, in store, other $table->string('description')->nullable(); $table->text('notes')->nullable(); $table->string('reference')->nullable(); $table->bigInteger('amount')->default(0); $table->boolean('pending')->default(false); $table->boolean('reviewed')->default(false); $table->dateTime('posted_at'); $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete(); $table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete(); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('transactions'); } };