Esempio n. 1
0
 public function appsAndWorkouts()
 {
     $apps = App::with("workouts")->get();
     $newApps = array();
     foreach ($apps as $app) {
         $newApps[$app->title] = $app->workouts->lists("title", "id")->toArray();
     }
     return $newApps;
 }