Ejemplo n.º 1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     # First get the user id
     $user_id = \App\User::where('name', '=', 'Jill')->pluck('id');
     # Next get the verb id
     $verb_id = \App\Verb::where('infinitive_it', '=', 'essere')->pluck('id');
     # Next get the tense id
     $tense_id = \App\Tense::where('tense', '=', 'Present Indicative')->pluck('id');
     DB::table('transactions')->insert(['user_id' => $user_id, 'verb_id' => $verb_id, 'tense_id' => $tense_id, 'response_1ps' => TRUE, 'response_2ps' => TRUE, 'response_3ps' => TRUE, 'response_1pp' => FALSE, 'response_2pp' => TRUE, 'response_3pp' => TRUE, 'pct_correct' => 83.3, 'created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString()]);
 }
Ejemplo n.º 2
0
 /**
  * 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]);
 }