PaymentFactory.php 747 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace Database\Factories;
  3. use App\Models\User;
  4. use Illuminate\Database\Eloquent\Factories\Factory;
  5. use Illuminate\Support\Str;
  6. class PaymentFactory extends Factory
  7. {
  8. /**
  9. * Define the model's default state.
  10. *
  11. * @return array
  12. */
  13. public function definition()
  14. {
  15. return [
  16. 'payment_id' => Str::random(30),
  17. 'payer_id' => Str::random(30),
  18. 'user_id' => User::factory(),
  19. 'type' => 'Credits',
  20. 'status' => 'Completed',
  21. 'amount' => $this->faker->numberBetween(10, 10000),
  22. 'price' => $this->faker->numerify('##.##'),
  23. 'currency_code' => ['EUR', 'USD'][rand(0, 1)],
  24. 'payer' => '{}',
  25. ];
  26. }
  27. }