faker->randomElement([Invoice::class, Estimate::class, Payment::class]); return [ 'from' => $this->faker->unique()->safeEmail(), 'to' => $this->faker->unique()->safeEmail(), 'subject' => $this->faker->sentence(), 'body' => $this->faker->text(), 'mailable_type' => (new $mailable)->getMorphClass(), 'mailable_id' => $mailable::factory(), ]; } }