Пример #1
0
 public function getIndex()
 {
     //get the pets
     $pets = \App\Pet::where('user_id', '=', \Auth::id())->orderBy('id', 'DESC')->get();
     return view('profile.index')->with('pets', $pets);
     //return 'here is the profile';
 }
Пример #2
0
 public function getIndex(Request $request)
 {
     // Get all the books "owned" by the current logged in users
     // Sort in descending order by id
     $pets = \App\Pet::where('user_id', '=', \Auth::id())->orderBy('id', 'DESC')->get();
     return view('profile.index')->with('pets', $pets);
 }
Пример #3
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function getProfile()
 {
     // get profile information
     $pets = \App\Pet::where('user_id', '=', \Auth::id())->orderBy('id', 'DESC')->get();
     //return view('profile.index')->with ('pets', $pets);
     //echo ('pets', $pets);
     dump($pets->toArray());
 }
Пример #4
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $client = Client::findOrFail($id);
     $pid = $client->id;
     $bairro = Bairro::where('id', $client->bairro)->get();
     $pets = Pet::where('owner_id', $pid)->get();
     $numbers = Number::where('clientid', $pid)->get();
     return view('clients.show', compact('client', 'pets', 'bairro', 'numbers'));
 }
Пример #5
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function getIndex()
 {
     //You want it to get the pets with a certain status, so the query changes like this
     $pets = \App\Pet::where('status', '=', 1)->orderBy('id', 'DESC')->get();
     return view('index')->with('pets', $pets);
 }
Пример #6
0
 /**
  * Get all of the pets for a given user.
  *
  * @param  User  $user
  * @return Collection
  */
 public function forUser(User $user)
 {
     return Pet::where('user_id', $user->id)->orderBy('created_at', 'desc')->get();
 }