Files
exchange/database/factories/BookingFactory.php

41 lines
1.4 KiB
PHP

<?php
use Faker\Generator as Faker;
$factory->define(App\Booking::class, function (Faker $faker) {
$rate_id = App\Rate::pluck('id')->toArray();
$user_id = App\User::pluck('id')->toArray();
return [
'account_name' => $faker->name,
'account_num' => $faker->unique()->randomDigit,
'bank_name' => $faker->name,
'bank_branch' => $faker->unique()->address,
'company_name' => $faker->name,
'company_address' => $faker->unique()->address,
'bank_address' => $faker->unique()->address,
'swift_code' => $faker->unique()->randomDigit,
'cnap' => $faker->randomDigit,
'term' => str_random(10),
'amount'=> $faker->randomDigit,
'rate_id' => $faker->randomElement($rate_id),
'user_id' => $faker->randomElement($user_id),
'rmb_book_amount' => $faker->randomDigit,
'rmb_book_pay_method' => str_random(10),
'rmb_book_account_name' => $faker->name,
'rmb_book_acc_no' => $faker->randomDigit,
'rmb_book_bank_branch' => $faker->unique()->address,
'usd_book_amount' => $faker->randomDigit,
'usd_book_pay_method'=> str_random(10),
'usd_book_company_name'=> $faker->name,
'usd_book_company_address' => $faker->unique()->address,
'usd_book_swift_code'=> $faker->unique()->randomDigit,
'usd_book_cnap' => $faker->randomDigit,
'usd_book_bank_branch' => $faker->unique()->address,
];
});