Esempio n. 1
0
 public static function getOptions($options)
 {
     $result = [];
     if (in_array('types', $options)) {
         $types = Type::applicable()->orderBy('name')->get(['id', 'name']);
         $result['types'] = $types;
     }
     if (in_array('mechanics', $options)) {
         $mechanics = Mechanic::applicable()->orderBy('name')->get(['id', 'name']);
         $result['mechanics'] = $mechanics;
     }
     if (in_array('forces', $options)) {
         $forces = Force::applicable()->orderBy('name')->get(['id', 'name']);
         $result['forces'] = $forces;
     }
     if (in_array('difficulties', $options)) {
         $difficulties = Difficulty::orderBy('id')->get(['id', 'name']);
         $result['difficulties'] = $difficulties;
     }
     if (in_array('muscles', $options)) {
         $muscles = Muscle::orderBy('name')->get(['id', 'name']);
         $result['muscles'] = $muscles;
     }
     return $result;
 }
Esempio n. 2
0
 public static function getOptions($options)
 {
     $result = [];
     if (in_array('goals', $options)) {
         $goals = Goal::orderBy('name')->get(['id', 'name']);
         $result['goals'] = $goals;
     }
     if (in_array('frequencies', $options)) {
         $frequencies = Frequency::orderBy('name')->get(['id', 'name']);
         $result['frequencies'] = $frequencies;
     }
     if (in_array('difficulties', $options)) {
         $difficulties = Difficulty::orderBy('id')->get(['id', 'name']);
         $result['difficulties'] = $difficulties;
     }
     return $result;
 }