コード例 #1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     //
     $breed = Breed::find($id);
     $listSpecies = Species::lists('species', 'id');
     $species_id = $breed['species_id'];
     return view('breed.edit', ['breed' => $breed, 'listSpecies' => $listSpecies, 'species_id' => $species_id]);
 }
コード例 #2
0
 public function createPetByClient($id)
 {
     //To create pet by client
     $client = Client::find($id);
     $species = Species::lists('species', 'id');
     $number = Pet::max('record_number');
     if ($number == null) {
         $number = 1;
     } else {
         $number++;
     }
     return view('pet.create', compact('client', 'species', 'number'));
 }