akaunting/database/seeds/Dashboards.php

50 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2019-11-16 10:21:14 +03:00
<?php
namespace Database\Seeds;
use App\Abstracts\Model;
2020-05-21 00:32:47 +03:00
use App\Jobs\Common\CreateDashboard;
use App\Traits\Jobs;
2019-11-16 10:21:14 +03:00
use Illuminate\Database\Seeder;
class Dashboards extends Seeder
{
2020-05-21 00:32:47 +03:00
use Jobs;
2019-11-16 10:21:14 +03:00
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
$this->create();
Model::reguard();
}
private function create()
{
$user_id = $this->command->argument('user');
$company_id = $this->command->argument('company');
2020-05-21 00:32:47 +03:00
$this->dispatch(new CreateDashboard([
2019-12-31 02:20:10 +03:00
'company_id' => $company_id,
2020-01-07 17:15:00 +03:00
'name' => trans_choice('general.dashboards', 1),
'custom_widgets' => [
2022-06-01 10:15:55 +03:00
'App\Widgets\Receivables',
'App\Widgets\Payables',
'App\Widgets\CashFlow',
2022-06-01 10:15:55 +03:00
'App\Widgets\ProfitLoss',
'App\Widgets\ExpensesByCategory',
'App\Widgets\AccountBalance',
2022-06-01 10:15:55 +03:00
'App\Widgets\BankFeeds',
],
2020-05-21 00:32:47 +03:00
'users' => $user_id,
2021-09-10 00:31:39 +03:00
'created_from' => 'core::seed',
2020-05-21 00:32:47 +03:00
]));
2019-11-16 10:21:14 +03:00
}
}