| <?php |
|
|
| namespace Database\Factories; |
|
|
| use Illuminate\Database\Eloquent\Factories\Factory; |
| use App\Models\Calificacion; |
| use App\Models\Alumno; |
| use App\Models\Materia; |
|
|
| |
| |
| |
| class CalificacionFactory extends Factory |
| { |
| protected $model = Calificacion::class; |
| |
| |
| |
| |
| |
| public function definition(): array |
| { |
| return [ |
| 'id_alumno' => Alumno::inRandomOrder()->first()->id_alumno ?? 1, |
| 'id_materia' => Materia::inRandomOrder()->first()->id_materia ?? 1, |
| 'calificacion' => $this->faker->randomFloat(1, 0, 10), |
| 'trimestre' => $this->faker->numberBetween(1, 5) |
|
|
|
|
| ]; |
| } |
| } |
|
|