| <?php |
|
|
| namespace Database\Factories; |
|
|
| use Illuminate\Database\Eloquent\Factories\Factory; |
| use App\Models\JustificanteMaestro; |
| use App\Models\Maestro; |
| use App\Models\Persona; |
| use Illuminate\Support\Facades\DB; |
|
|
| |
| |
| |
| class JustificanteMaestroFactory extends Factory |
| { |
| protected $model = JustificanteMaestro::class; |
| |
| |
| |
| |
| |
| public function definition(): array |
| { |
| return [ |
| 'id_maestro' => Maestro::inRandomOrder()->first()->id_maestro ?? 1, |
| 'persona_id'=>$this->faker->unique()->numberBetween(1,DB::table('personas')->count()), |
| 'motivo'=>$this->faker->sentence(), |
| 'fecha'=>$this->faker->date() |
| ]; |
| } |
| } |
|
|