32 lines
723 B
PHP
32 lines
723 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Str;
|
|
use App\Models\Compra;
|
|
use App\Models\Proveedore;
|
|
|
|
class CompraFactory extends Factory
|
|
{
|
|
/**
|
|
* The name of the factory's corresponding model.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $model = Compra::class;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'fecha' => fake()->dateTime(),
|
|
'proveedor_id' => Proveedore::factory(),
|
|
'total' => fake()->randomFloat(2, 0, 99999999.99),
|
|
'estado' => fake()->randomElement(["Recibida","Pendiente","Anulada"]),
|
|
];
|
|
}
|
|
}
|