mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -04:00
23 lines
669 B
PHP
23 lines
669 B
PHP
<?php
|
|
|
|
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
|
|
|
use Crater\Payment;
|
|
use Crater\PaymentMethod;
|
|
use Crater\User;
|
|
use Crater\Invoice;
|
|
use Faker\Generator as Faker;
|
|
|
|
$factory->define(Payment::class, function (Faker $faker) {
|
|
return [
|
|
'user_id' => function () {
|
|
return factory(User::class)->create(['role' => 'customer'])->id;
|
|
},
|
|
'payment_date' => $faker->date($format = 'Y-m-d', $max = 'now'),
|
|
'company_id' => User::find(1)->company_id,
|
|
'notes' => $faker->text(80),
|
|
'amount' => $faker->randomDigitNotNull,
|
|
'payment_number' => 'PAY-'.Payment::getNextPaymentNumber('PAY'),
|
|
];
|
|
});
|