Пример #1
0
 public function getEdit($id = null)
 {
     # Get this bird and eager load its tags
     $bird = \Birdwatcher\Bird::with('rarity_id')->find($id);
     if (is_null($bird)) {
         \Session::flash('flash_message', 'bird not found.');
         return redirect('\\birds');
     }
     # Get all the possible authors so we can build the authors dropdown in the view
     $raritiesModel = new \Birdwatcher\Rarity();
     $authors_for_dropdown = $authorModel->getAuthorsForDropdown();
     return view('birds.edit')->with(['bird' => $bird, 'rarities_for_dropdown' => $rarities_for_dropdown]);
 }