*/ class OutflowFactory extends Factory { public function definition(): array { return [ 'stream_id' => null, 'bucket_id' => null, 'amount' => $this->faker->numberBetween(2500, 100000), // $25 to $1000 in cents 'date' => $this->faker->dateTimeBetween('-6 months', 'now'), 'description' => $this->faker->sentence(), 'is_projected' => $this->faker->boolean(), ]; } public function stream(Stream $stream): self { return $this->state(fn () => [ 'stream_id' => $stream->id, ]); } public function bucket(Bucket $bucket): self { return $this->state(fn () => [ 'bucket_id' => $bucket->id, ]); } }