vendredi 8 avril 2016

Why can't I access laravel relationship columns if I create new instance instead of using let's say "Article::all()"?

I'm confused to why can't I access the relationship I setup if I use this code:

$products = new Products();

If I use this, I can access my laravel relationship columns.

$products = Products::all();

What's the difference?

Aucun commentaire:

Enregistrer un commentaire