public function myRecipes($flag) { if ($flag == 1) { return tbl_recipes::where('added_by', '=', Auth::user()->id)->count(); } else { return tbl_recipes::where('added_by', '=', Auth::user()->id)->get(); } }
public function myRecipes() { return tbl_recipes::where('added_by', '=', $this->id)->get(); }