mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 14:09:43 -08:00
42 lines
872 B
PHP
42 lines
872 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Accessory;
|
|
use App\Models\Asset;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class CheckoutAcceptanceFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function definition()
|
|
{
|
|
return [
|
|
'checkoutable_type' => Asset::class,
|
|
'checkoutable_id' => Asset::factory(),
|
|
'assigned_to_id' => User::factory(),
|
|
];
|
|
}
|
|
|
|
public function forAccessory()
|
|
{
|
|
return $this->state([
|
|
'checkoutable_type' => Accessory::class,
|
|
'checkoutable_id' => Accessory::factory(),
|
|
]);
|
|
}
|
|
|
|
public function pending()
|
|
{
|
|
return $this->state([
|
|
'accepted_at' => null,
|
|
'declined_at' => null,
|
|
]);
|
|
}
|
|
}
|