ProcurementFactory.php 827 B

123456789101112131415161718192021222324
  1. <?php
  2. /** @var \Illuminate\Database\Eloquent\Factory $factory */
  3. use App\Procurement;
  4. use Faker\Generator as Faker;
  5. $factory->define(Procurement::class, function (Faker $faker) {
  6. return [
  7. 'code' => $faker->uuid,
  8. 'owner_material_id' => random_int(1, 100),
  9. 'supplier_id' => random_int(1, 100),
  10. 'quantity' => random_int(1, 100),
  11. 'amount' => random_int(1, 100),
  12. 'unit_price' => random_int(1, 100),
  13. 'cost_price' => random_int(1, 100),
  14. 'status' => random_int(0, 11),
  15. 'initiator' => random_int(1, 100),
  16. 'type' => random_int(0, 100),
  17. 'deadline' => now(),
  18. 'created_at' => now()->subMonth()->startOfMonth()->addDays(random_int(0, 28)),
  19. 'updated_at' => now()->subMonth()->startOfMonth()->addDays(random_int(0, 28)),
  20. ];
  21. });