Appearance
Part 6 - Database
PREREQUISITES
- Finished Laravel exercise -> Part 5 - Components
- Finished Laravel -> Database migrations
- Finished Laravel -> Eloquent models: Part 1
- Finished Laravel -> Eloquent models: Part 2
- Create the correct migrations and Eloquent models for the following database schema
- Add relationships between the Eloquent models

REMARKS
- The many side of the relationship always holds the foreign key
- A programme can have multiple students subscribed ->
programme_idis defined in students table
- A programme can have multiple students subscribed ->
- A student can enroll in multiple courses AND a course can be followed by multiple students. This is a many-to-many relationship which we have to implement by using an associative table student_courses.
- If you use the command
php artisan make:model StudentCourse -m, the corresponding database table will be named student_courses. According to the naming conventions, we also advice to usestudentcourses()as the associated Eloquent hasMany relationship method.
- If you use the command
- Add some test data to these tables