akaunting/database/seeds/Dashboards.php

41 lines
781 B
PHP
Raw 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),
2020-12-25 17:00:13 +03:00
'default_widgets' => true,
2020-05-21 00:32:47 +03:00
'users' => $user_id,
]));
2019-11-16 10:21:14 +03:00
}
}