Courses / Laravel Blog API: Intermediate Hands‑On Course
Lesson 3 of 9

Eloquent Models and Relationships

Video by Laracasts on YouTube · 8 min. We did not make this video and we do not host it — watching it here still counts as a view for the creator.

Watch how to define hasMany and belongsTo relationships for User‑Post and Post‑Comment. Beginners often forget to add the foreign key column or mismatch naming conventions, causing empty relation results.

In a real blog API, eager loading (with) prevents N+1 query problems and improves performance dramatically.

Start learning free

Sign in with WhatsApp, your phone number, email or Google. No password. The same account carries your progress, your certificates and anything else you do with Nexgino later.

Sign in to continue

It takes about fifteen seconds.

Previous Next lesson All lessons