feat(factory): membuat botol dan formula factory
This commit is contained in:
parent
1573ac21ec
commit
e006b71325
23
database/factories/BottleFactory.php
Normal file
23
database/factories/BottleFactory.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Bottle>
|
||||
*/
|
||||
class BottleFactory extends Factory
|
||||
{
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->word(),
|
||||
'slug' => $this->faker->slug(),
|
||||
'size' => $this->faker->randomNumber(2),
|
||||
'cost_price' => $this->faker->randomNumber(2),
|
||||
'sale_price' => $this->faker->randomNumber(2),
|
||||
'description' => $this->faker->sentence(),
|
||||
];
|
||||
}
|
||||
}
|
||||
20
database/factories/FormulaFactory.php
Normal file
20
database/factories/FormulaFactory.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Formula>
|
||||
*/
|
||||
class FormulaFactory extends Factory
|
||||
{
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'quality' => $this->faker->word(),
|
||||
'size' => $this->faker->randomNumber(2),
|
||||
'volume' => $this->faker->randomNumber(2),
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user