/** * Responds to requests to GET /conjugation/show/{$id} */ public function getRandom() { // # Get this conjugation and eager load the verb and tense information $conjugation = \App\Conjugation::with('verb', 'tense')->get(); # Not most efficient implementation. Thus far unable to get random working with above statement. $conjugation = $conjugation->random(); $formModel = new \App\Form(); $person_array = $formModel->getPersonArray(); return view('conjugations.random')->with(['conjugation' => $conjugation, 'person_array' => $person_array]); }
/** * Responds to requests to GET /verbs/display * Displays a list of all verbs in the database. */ public function getDisplay() { $verbs = \App\Verb::orderBy('infinitive_it', 'ASC')->get(); $tenses = \App\Tense::all(); $conjugations = \App\Conjugation::all(); // dump($verbs); // dump($tenses); // dump($conjugations); return view('verbs.display')->with(['verbs' => $verbs, 'tenses' => $tenses, 'conjugations' => $conjugations]); }