snipe-it/database/seeds/DatabaseSeeder.php

54 lines
1.6 KiB
PHP
Raw Normal View History

2016-03-25 01:18:05 -07:00
<?php
use App\Models\Setting;
2016-03-25 01:18:05 -07:00
use Illuminate\Database\Eloquent\Model;
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();
// Only create default settings if they do not exist in the db.
if (! Setting::first()) {
// factory(Setting::class)->create();
$this->call(SettingsSeeder::class);
}
$this->call(CompanySeeder::class);
$this->call(CategorySeeder::class);
$this->call(LocationSeeder::class);
$this->call(UserSeeder::class);
$this->call(DepreciationSeeder::class);
2017-10-07 03:18:46 -07:00
$this->call(DepartmentSeeder::class);
$this->call(ManufacturerSeeder::class);
$this->call(SupplierSeeder::class);
2016-03-25 01:18:05 -07:00
$this->call(AssetModelSeeder::class);
$this->call(DepreciationSeeder::class);
$this->call(StatuslabelSeeder::class);
2016-03-25 01:18:05 -07:00
$this->call(AccessorySeeder::class);
$this->call(AssetSeeder::class);
$this->call(LicenseSeeder::class);
$this->call(ComponentSeeder::class);
2016-03-25 01:18:05 -07:00
$this->call(ConsumableSeeder::class);
$this->call(ActionlogSeeder::class);
$this->call(CustomFieldSeeder::class);
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();
DB::table('asset_maintenances')->truncate();
DB::table('requested_assets')->truncate();
2016-03-25 01:18:05 -07:00
}
}