snipe-it/database/factories/DepreciationFactory.php
snipe 0e3bafd5b4 Fixed depreciation tests
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 19:19:42 -08:00

69 lines
1.4 KiB
PHP

<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/*
|--------------------------------------------------------------------------
| Asset Model Factories
|--------------------------------------------------------------------------
|
| Factories related exclusively to creating models ..
|
*/
class DepreciationFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = \App\Models\Depreciation::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'name' => $this->faker->catchPhrase(),
'user_id' => 1,
'months' => 36,
];
}
public function computer()
{
return $this->state(function () {
return [
'name' => 'Computer Depreciation',
'months' => 36,
];
});
}
public function display()
{
return $this->state(function () {
return [
'name' => 'Display Depreciation',
'months' => 12,
];
});
}
public function mobilePhones()
{
return $this->state(function () {
return [
'name' => 'Mobile Phone Depreciation',
'months' => 24,
];
});
}
}