2016-03-25 01:18:05 -07:00
|
|
|
<?php
|
2021-06-10 13:15:52 -07:00
|
|
|
|
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;
|
2021-06-10 13:15:52 -07:00
|
|
|
use Illuminate\Database\Seeder;
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
class ActionlogSeeder extends Seeder
|
|
|
|
{
|
2021-06-10 13:15:52 -07:00
|
|
|
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();
|
2021-06-10 13:15:52 -07:00
|
|
|
}
|
2016-03-25 01:18:05 -07:00
|
|
|
}
|