Няма описание

1234567891011121314151617181920
  1. <?php
  2. /* @var $factory \Illuminate\Database\Eloquent\Factory */
  3. use App\Section;
  4. use Faker\Generator as Faker;
  5. use App\Semester;
  6. use App\Course;
  7. $factory->define(Section::class, function (Faker $faker) {
  8. // dd(Semester::all()->pluck('code')->toArray());
  9. return [
  10. 'semester_code' => $faker->randomElement(Semester::all()->pluck('code')->toArray()),
  11. 'course_id' => $faker->numberBetween(1, Course::count()),
  12. 'code' => $faker->lexify('???'),
  13. 'student_count' => $faker->optional()->randomNumber(3),
  14. 'syllabus' => $faker->optional()->text(),
  15. 'credits' => $faker->optional()->randomFloat(2,0,4),
  16. ];
  17. });