3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-04-10 09:48:13 +00:00
Files
snipe-it/database/factories/MaintenanceFactory.php
2026-03-13 18:12:37 +00:00

42 lines
1.1 KiB
PHP

<?php
namespace Database\Factories;
use App\Models\Asset;
use App\Models\Maintenance;
use App\Models\Supplier;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
class MaintenanceFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Maintenance::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'asset_id' => Asset::factory()->laptopZenbook(),
'supplier_id' => Supplier::factory(),
'asset_maintenance_type' => $this->faker->randomElement(['maintenance', 'repair', 'upgrade']),
'name' => $this->faker->sentence(3),
'start_date' => $this->faker->date(),
'is_warranty' => $this->faker->boolean(),
'notes' => $this->faker->paragraph(),
'url' => $this->faker->url(),
'cost' => $this->faker->randomFloat(),
'created_by' => User::factory()->superuser(),
'image' => $this->faker->numberBetween(1, 11).'.png',
];
}
}