示例#1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     $cats = Cat::where('is_public', '=', true)->orwhere('created_user_id', '=', Auth::id())->get();
     return view('cats.index')->with('cats', $cats);
 }
示例#2
0
文件: Cat.php 项目: zhukangfeng/cats
 public static function getPet($user_id)
 {
     $cats = Cat::where('created_user_id', '=', $user_id)->get();
     return $cats;
 }