first commit
This commit is contained in:
33
database/factories/ServiceCatalogFactory.php
Normal file
33
database/factories/ServiceCatalogFactory.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\ServiceCatalog;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<ServiceCatalog>
|
||||
*/
|
||||
class ServiceCatalogFactory extends Factory
|
||||
{
|
||||
protected $model = ServiceCatalog::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$name = fake()->unique()->words(2, true);
|
||||
|
||||
return [
|
||||
'code' => str(fake()->unique()->slug(2))->replace('-', '_')->value(),
|
||||
'name' => mb_convert_case($name, MB_CASE_TITLE, 'UTF-8'),
|
||||
'unit' => fake()->randomElement(['усл.', 'иссл.', 'проц.']),
|
||||
'default_price' => fake()->randomFloat(2, 10, 10000),
|
||||
'sort_order' => fake()->numberBetween(1, 100),
|
||||
'is_active' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user