2016-03-25 01:18:05 -07:00
|
|
|
<?php
|
|
|
|
|
2018-03-27 17:43:28 -07:00
|
|
|
use App\Models\Setting;
|
2016-03-25 01:18:05 -07:00
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2018-03-27 17:43:28 -07:00
|
|
|
use Illuminate\Database\Seeder;
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
class DatabaseSeeder extends Seeder
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the database seeds.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function run()
|
|
|
|
{
|
|
|
|
Model::unguard();
|
|
|
|
|
2018-10-09 16:12:26 -07:00
|
|
|
// Only create default settings if they do not exist in the db.
|
|
|
|
if(!Setting::first()) {
|
|
|
|
// factory(Setting::class)->create();
|
|
|
|
$this->call(SettingsSeeder::class);
|
|
|
|
}
|
|
|
|
|
2016-09-29 22:20:49 -07:00
|
|
|
$this->call(CompanySeeder::class);
|
2017-01-18 16:50:33 -08:00
|
|
|
$this->call(CategorySeeder::class);
|
2020-04-28 09:14:23 -07:00
|
|
|
$this->call(LocationSeeder::class);
|
2016-09-29 22:20:49 -07:00
|
|
|
$this->call(UserSeeder::class);
|
2017-01-18 16:50:33 -08:00
|
|
|
$this->call(DepreciationSeeder::class);
|
2017-10-07 03:18:46 -07:00
|
|
|
$this->call(DepartmentSeeder::class);
|
2016-11-20 19:59:57 -08:00
|
|
|
$this->call(ManufacturerSeeder::class);
|
2017-01-18 16:50:33 -08:00
|
|
|
$this->call(SupplierSeeder::class);
|
2016-03-25 01:18:05 -07:00
|
|
|
$this->call(AssetModelSeeder::class);
|
2017-01-22 14:57:09 -08:00
|
|
|
$this->call(DepreciationSeeder::class);
|
|
|
|
$this->call(StatuslabelSeeder::class);
|
2016-03-25 01:18:05 -07:00
|
|
|
$this->call(AccessorySeeder::class);
|
|
|
|
$this->call(AssetSeeder::class);
|
2017-01-18 16:50:33 -08:00
|
|
|
$this->call(LicenseSeeder::class);
|
2016-09-29 22:20:49 -07:00
|
|
|
$this->call(ComponentSeeder::class);
|
2016-03-25 01:18:05 -07:00
|
|
|
$this->call(ConsumableSeeder::class);
|
|
|
|
$this->call(ActionlogSeeder::class);
|
|
|
|
$this->call(CustomFieldSeeder::class);
|
|
|
|
|
2018-10-09 16:12:26 -07:00
|
|
|
|
2017-11-22 06:21:56 -08:00
|
|
|
Artisan::call('snipeit:sync-asset-locations', ['--output' => 'all']);
|
|
|
|
$output = Artisan::output();
|
|
|
|
\Log::info($output);
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
Model::reguard();
|
2019-04-18 11:13:33 -07:00
|
|
|
|
|
|
|
DB::table('imports')->truncate();
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
}
|
|
|
|
}
|