2021-06-10 13:17:44 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Database\Factories;
|
|
|
|
|
|
|
|
use App\Models\Asset;
|
|
|
|
use App\Models\AssetModel;
|
|
|
|
use App\Models\Category;
|
2023-03-14 14:59:34 -07:00
|
|
|
use App\Models\Supplier;
|
2021-06-10 13:19:27 -07:00
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
2021-06-10 13:17:44 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Model Factories
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Factories related exclusively to modelling assets.
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
class AssetMaintenanceFactory extends Factory
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The name of the factory's corresponding model.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $model = \App\Models\AssetMaintenance::class;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Define the model's default state.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function definition()
|
|
|
|
{
|
|
|
|
return [
|
2023-03-14 14:59:34 -07:00
|
|
|
'asset_id' => Asset::factory(),
|
|
|
|
'supplier_id' => Supplier::factory(),
|
2021-06-10 13:17:44 -07:00
|
|
|
'asset_maintenance_type' => $this->faker->randomElement(['maintenance', 'repair', 'upgrade']),
|
2023-03-16 17:07:46 -07:00
|
|
|
'title' => $this->faker->sentence(),
|
2021-06-10 13:17:44 -07:00
|
|
|
'start_date' => $this->faker->date(),
|
|
|
|
'is_warranty' => $this->faker->boolean(),
|
|
|
|
'notes' => $this->faker->paragraph(),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|