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.
|
|
<?php
/** @var Factory $factory */
use Carbon\Carbon; use App\Models\Cost; use Faker\Generator as Faker;
$factory->define(Cost::class, function (Faker $faker) { return [ 'business_id' => random_int(1,5000), 'type' => $type = $faker->boolean() ? 'users' : 'files', 'month' => jdate(Carbon::now()->subDays(random_int(0,90)))->format("Y-m-01"), 'amount' => random_int(1,1000), 'fee' => $type === 'users' ? enum("business.fee.user") : enum("business.fee.file"), 'duration' => random_int(1,60), 'created_at' => Carbon::now()->subMinutes(random_int(1, 1000)), ]; });
|