42 lines
1.1 KiB
PHP
Raw Normal View History

2020-01-14 01:05:32 +03:00
<?php
2020-10-14 17:07:59 +03:00
namespace Database\Factories;
use App\Abstracts\Factory;
2020-01-14 01:05:32 +03:00
use App\Models\Banking\Account;
2020-10-14 17:07:59 +03:00
use App\Models\Banking\Transfer as Model;
2020-01-14 01:05:32 +03:00
2020-10-14 17:07:59 +03:00
class Transfer extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Model::class;
2020-01-14 01:05:32 +03:00
2020-10-14 17:07:59 +03:00
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
2022-12-16 10:26:41 +03:00
$from_account = Account::factory()->enabled()->default_currency()->create();
2020-01-14 01:05:32 +03:00
2022-12-16 10:26:41 +03:00
$to_account = Account::factory()->enabled()->default_currency()->create();
2020-01-14 01:05:32 +03:00
2022-12-16 10:26:41 +03:00
return [
'company_id' => $this->company->id,
'from_account_id' => $from_account->id,
'to_account_id' => $to_account->id,
2020-10-14 17:07:59 +03:00
'amount' => $this->faker->randomFloat(2, 1, 1000),
2022-12-16 10:26:41 +03:00
'transferred_at' => $this->faker->date(),
'description'=> $this->faker->text(20),
'payment_method' => setting('default.payment_method'),
2020-10-14 17:07:59 +03:00
'reference' => $this->faker->text(20),
2021-09-10 00:31:39 +03:00
'created_from' => 'core::factory',
2020-10-14 17:07:59 +03:00
];
}
}