| 12345678910111213141516171819 |
- <?php
- /** @var \Illuminate\Database\Eloquent\Factory $factory */
- use App\OwnerLogisticPrintTemplate;
- use Faker\Generator as Faker;
- $factory->define(OwnerLogisticPrintTemplate::class, function (Faker $faker) {
- $owner = \App\Owner::query()->get();
- $logistics = \App\Logistic::query()->get();
- $delivery_interfaces = ['TB','PDD','JD','SF','SFQHD'];
- return [
- 'owner_id' => $owner->random(1)->first()['id'],
- 'logistic_id' => $logistics->random(1)->first()['id'],
- 'print_template_id' => \App\PrintTemplate::query()->first(),
- 'delivery_interface' => $delivery_interfaces[rand(0,count($delivery_interfaces)-1)]
- ];
- });
|