snipe-it/database/seeders/ActionlogSeeder.php

35 lines
668 B
PHP
Raw Normal View History

2016-03-25 01:18:05 -07:00
<?php
2021-06-10 13:18:00 -07:00
namespace Database\Seeders;
2016-03-25 01:18:05 -07:00
use App\Models\Actionlog;
2023-03-16 15:25:23 -07:00
use App\Models\Asset;
use App\Models\Location;
use Illuminate\Database\Seeder;
2016-03-25 01:18:05 -07:00
class ActionlogSeeder extends Seeder
{
public function run()
{
Actionlog::truncate();
2023-03-16 15:25:23 -07:00
if (! Asset::count()) {
$this->call(AssetSeeder::class);
}
if (! Location::count()) {
$this->call(LocationSeeder::class);
}
Actionlog::factory()
->count(300)
->assetCheckoutToUser()
->create();
Actionlog::factory()
->count(100)
->assetCheckoutToLocation()
->create();
}
2016-03-25 01:18:05 -07:00
}