akaunting/database/seeds/Accounts.php

45 lines
907 B
PHP
Raw Permalink Normal View History

2017-09-14 22:21:00 +03:00
<?php
namespace Database\Seeds;
2019-11-16 10:21:14 +03:00
use App\Abstracts\Model;
2021-09-06 14:46:42 +03:00
use App\Jobs\Banking\CreateAccount;
use App\Traits\Jobs;
2017-09-14 22:21:00 +03:00
use Illuminate\Database\Seeder;
class Accounts extends Seeder
{
2021-09-06 14:46:42 +03:00
use Jobs;
2017-09-14 22:21:00 +03:00
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
$this->create();
Model::reguard();
}
private function create()
{
2018-07-15 15:07:56 +03:00
$company_id = $this->command->argument('company');
2017-09-14 22:21:00 +03:00
2021-09-06 14:46:42 +03:00
$account = $this->dispatch(new CreateAccount([
2020-01-06 16:37:32 +03:00
'company_id' => $company_id,
'name' => trans('demo.accounts.cash'),
'number' => '1',
'currency_code' => 'USD',
'bank_name' => trans('demo.accounts.cash'),
'enabled' => '1',
2021-09-10 00:31:39 +03:00
'created_from' => 'core::seed',
2021-09-06 14:46:42 +03:00
]));
2020-01-06 16:37:32 +03:00
setting()->set('default.account', $account->id);
2017-09-14 22:21:00 +03:00
}
}