예제 #1
0
 public function unbookmark($tracking_nr)
 {
     $list = static::DEFAULT_LIST;
     $language = Input::get('language', static::$default_language);
     $recipe = Recipe::select('id')->where('tracking_nr', '=', $tracking_nr)->where('language', '=', $language)->first();
     if (!$recipe) {
         abort(500);
     }
     DB::table('recipe_bookmarks')->where('recipe_id', $recipe['id'])->where('user_id', Auth::user()->id)->where('list', $list)->delete();
     return redirect()->route('recipes.show', ['recipes' => $tracking_nr])->with('lang', $language);
 }