コード例 #1
0
ファイル: CatController.php プロジェクト: zhukangfeng/cats
 /**
  * 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;
 }