mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-17 11:04:07 -08:00
81 lines
1.8 KiB
PHP
81 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class CustomFieldFactory extends Factory
|
|
{
|
|
/**
|
|
* The name of the factory's corresponding model.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $model = \App\Models\CustomField::class;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function definition()
|
|
{
|
|
return [
|
|
'name' => $this->faker->catchPhrase,
|
|
'format' => '',
|
|
'element' => 'text',
|
|
];
|
|
}
|
|
|
|
public function imei()
|
|
{
|
|
return $this->state(function () {
|
|
return [
|
|
'name' => 'IMEI',
|
|
'help_text' => 'The IMEI number for this device.',
|
|
'format' => 'regex:/^[0-9]{15}$/',
|
|
];
|
|
});
|
|
}
|
|
|
|
public function phone()
|
|
{
|
|
return $this->state(function () {
|
|
return [
|
|
'name' => 'Phone Number',
|
|
'help_text' => 'Enter the phone number for this device.',
|
|
];
|
|
});
|
|
}
|
|
|
|
public function ram()
|
|
{
|
|
return $this->state(function () {
|
|
return [
|
|
'name' => 'RAM',
|
|
'help_text' => 'The amount of RAM this device has.',
|
|
];
|
|
});
|
|
}
|
|
|
|
public function cpu()
|
|
{
|
|
return $this->state(function () {
|
|
return [
|
|
'name' => 'CPU',
|
|
'help_text' => 'The speed of the processor on this device.',
|
|
];
|
|
});
|
|
}
|
|
|
|
public function macAddress()
|
|
{
|
|
return $this->state(function () {
|
|
return [
|
|
'name' => 'MAC Address',
|
|
'format' => 'regex:/^([0-9a-fA-F]{2}[:-]){5}[0-9a-fA-F]{2}$/',
|
|
];
|
|
});
|
|
}
|
|
}
|