Use whereBelongsTo() and relation()->is() instead of comparing ids manually

Use whereBelongsTo() and relation()->is() instead of comparing ids manually

🔥 Tip: You don't have to use "related_id"-type columns in database queries or value comparisons.

Laravel understands your relations and lets you write much cleaner code.

We're writing a book, you can get it for free here.