mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-12 16:44:08 -08:00
2a95a95e00
* Fix the actionlog/companyables problem by adding a company_id to all actionlogs and scoping directly on that. Works around bugs in laravel where trying to hunt down the polymorphic relationship would lead to an infinite loop * Scope companyables in getactivityreport. Also eager load. * Improve reportscontroller, work on seeder to test this. * Only show company users in checkout dialogs * If no admin associated with log, it might be a request. Leave blank instead of saying deleted admin * When injecting company_id, use target instead of user if user is a superadmin * Build up the seeder to generate users, companies, and logs. * Eager load the log, don't scope the users log because the log should already include things only related to the user.
37 lines
1,002 B
PHP
37 lines
1,002 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class DatabaseSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run()
|
|
{
|
|
Model::unguard();
|
|
|
|
$this->call(CompanySeeder::class);
|
|
$this->call(UserSeeder::class);
|
|
$this->call(AssetModelSeeder::class);
|
|
$this->call(AccessorySeeder::class);
|
|
$this->call(AssetSeeder::class);
|
|
$this->call(ComponentSeeder::class);
|
|
$this->call(ConsumableSeeder::class);
|
|
$this->call(StatuslabelSeeder::class);
|
|
$this->call(SupplierSeeder::class);
|
|
$this->call(CategorySeeder::class);
|
|
$this->call(LicenseSeeder::class);
|
|
$this->call(ActionlogSeeder::class);
|
|
$this->call(DepreciationSeeder::class);
|
|
$this->call(ManufacturerSeeder::class);
|
|
$this->call(LocationSeeder::class);
|
|
$this->call(CustomFieldSeeder::class);
|
|
|
|
Model::reguard();
|
|
}
|
|
}
|