public function editCapture($id) { // This will find the capture id in the database $capture = Capture::findOrFail($id); $allPokemon = Pokemon::orderBy('name')->get(); return view('pokecentre.editCapture', compact('capture', 'allPokemon')); }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($name) { // Get additional information about the Pokemon $pokemon = Pokemon::where('name', $name)->firstOrFail(); // Show the contents of that pokemon on a view return view('pokedex.show', compact('pokemon')); }
public function editCapture($id) { //$capture = Capture::findOrFail($id); try { $capture = Capture::where('user_id', \Auth::user()->id)->where('id', $id)->firstOrFail(); } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $e) { return view('errors.captureNotFound'); } $allPokemon = Pokemon::orderBy('name')->get(); return view('pokecentre.editCapture', compact('capture', 'allPokemon')); }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($name) { // Get additional info about the pokemon $pokemon = Pokemon::where('name', $name)->firstOrFail(); return view('pokedex.show', compact('pokemon')); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // Get all Pokemon from the database $allPokemon = Pokemon::all(); return view('pokedex.index', compact('allPokemon')); }