OwnerLogisticPrintTemplateFactory.php 665 B

12345678910111213141516171819
  1. <?php
  2. /** @var \Illuminate\Database\Eloquent\Factory $factory */
  3. use App\OwnerLogisticPrintTemplate;
  4. use Faker\Generator as Faker;
  5. $factory->define(OwnerLogisticPrintTemplate::class, function (Faker $faker) {
  6. $owner = \App\Owner::query()->get();
  7. $logistics = \App\Logistic::query()->get();
  8. $delivery_interfaces = ['TB','PDD','JD','SF','SFQHD'];
  9. return [
  10. 'owner_id' => $owner->random(1)->first()['id'],
  11. 'logistic_id' => $logistics->random(1)->first()['id'],
  12. 'print_template_id' => \App\PrintTemplate::query()->first(),
  13. 'delivery_interface' => $delivery_interfaces[rand(0,count($delivery_interfaces)-1)]
  14. ];
  15. });