From the course: Laravel Essential Training

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Challenge: Define a new relationship and use it

Challenge: Define a new relationship and use it - Laravel Tutorial

From the course: Laravel Essential Training

Challenge: Define a new relationship and use it

Here's the last challenge. We created a notebook resource in the previous challenge and helped the user organize notes into notebooks. Now, find out the relation between our note resource and the new notebook resource, and define the relationship in both the models. Using this relationship, in the show view of a note, display the notebook of this note at the top. It should look something like this. This is a quick one. Good luck!

Contents