示例#1
0
 /**
  * Display the specified resource.
  *
  * @param  int  
  * @return \Illuminate\Http\Response
  */
 public function show()
 {
     $user = User::all();
     $dog = Dog::all();
     //$dog = Dog::find(3);
     return view('users', ['users' => $user, 'dogs' => $dog]);
 }
示例#2
0
 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $segment = Request::segment(1);
     $urlname = Request::segment(2);
     if ($segment == 'dog') {
         $asset = Dog::where('url_name', $urlname)->first();
     } elseif ($segment == 'kennel') {
         $asset = Kennel::where('url_name', $urlname)->first();
     }
     $view->with('segment', $segment)->with('asset', $asset);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     return Dog::destroy($id);
 }