How are you querying it? What is your primary key for both Ingredient and Recipe?
Both are the default 'id'.
$recipe = Recipe::find(1); var_dump($recipe->ingredients);
That's weird. That should work. Does it still not work if you eagerload it?
$recipe = Recipe::with('ingredients')->find(1); var_dump($recipe->ingredients);
thomastkim said:
That's weird. That should work. Does it still not work if you eagerload it?
$recipe = Recipe::with('ingredients')->find(1); var_dump($recipe->ingredients);
you beat me to it...
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community