random()->id; $toAccountId = Account::all()->random()->id; return [ 'from_account_id' => $fromAccountId, 'to_account_id' => $toAccountId, // 'creator_user_id' => Account::find($fromAccountId)->accountable->id, 'creator_user_id' => 1, 'amount' => $this->faker->numberBetween(15, 2000), 'description' => $this->faker->sentence(), // Transactions must have an existing type (see Transaction::booted()) 'transaction_type_id' => fn () => TransactionType::orderBy('id')->value('id'), ]; } }