akaunting/database/seeds/Dashboards.php
2020-05-21 00:32:47 +03:00

41 lines
778 B
PHP

<?php
namespace Database\Seeds;
use App\Abstracts\Model;
use App\Jobs\Common\CreateDashboard;
use App\Traits\Jobs;
use Illuminate\Database\Seeder;
class Dashboards extends Seeder
{
use Jobs;
/**
* 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');
$this->dispatch(new CreateDashboard([
'company_id' => $company_id,
'name' => trans_choice('general.dashboards', 1),
'with_widgets' => true,
'users' => $user_id,
]));
}
}