Support the ongoing development of Laravel.io →
posted 9 years ago
Eloquent
Last updated 2 years ago.
0

You can display workoutdays for routines that belongs to user this way

$routines = $user->routines;
@foreach ($routines as $routine)
   /* here you can use $routine->workoutdays */
@endforeach

In

$user->routines->workoutdays;

you are trying to get collection property from collection, it is not possible.
If user had only one routine it will be possible, so you need to iterate through the user routines and display workout days for each routine separately.

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Jackpump jackpump Joined 16 Nov 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.