You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
628 B

  1. <?php
  2. /** @var Factory $factory */
  3. use Carbon\Carbon;
  4. use App\Models\Cost;
  5. use Faker\Generator as Faker;
  6. $factory->define(Cost::class, function (Faker $faker) {
  7. return [
  8. 'business_id' => random_int(1,5000),
  9. 'type' => $type = $faker->boolean() ? 'users' : 'files',
  10. 'month' => jdate(Carbon::now()->subDays(random_int(0,90)))->format("Y-m-01"),
  11. 'amount' => random_int(1,1000),
  12. 'fee' => $type === 'users' ? enum("business.fee.user") : enum("business.fee.file"),
  13. 'duration' => random_int(1,60),
  14. 'created_at' => Carbon::now()->subMinutes(random_int(1, 1000)),
  15. ];
  16. });