phpvms/app/Database/factories/JournalTransactionsFactory.php

21 lines
613 B
PHP
Raw Normal View History

<?php
2021-04-13 21:25:38 +08:00
use App\Models\Journal;
use Carbon\Carbon;
use Faker\Generator as Faker;
2021-04-13 21:25:38 +08:00
use Ramsey\Uuid\Uuid;
2021-04-13 21:25:38 +08:00
$factory->define(App\Models\JournalTransaction::class, function (Faker $faker) {
return [
2021-04-13 21:25:38 +08:00
'transaction_group' => Uuid::uuid4()->toString(),
'journal_id' => function () {
2021-04-13 21:25:38 +08:00
return factory(Journal::class)->create()->id;
},
2018-08-27 00:40:04 +08:00
'credit' => $faker->numberBetween(100, 10000),
'debit' => $faker->numberBetween(100, 10000),
'currency' => 'USD',
'memo' => $faker->sentence(6),
2021-04-13 21:25:38 +08:00
'post_date' => Carbon::now('UTC'),
];
});