Commit a7aed38e authored by King Alex's avatar King Alex

Ajout API

parent 24397541
......@@ -10,8 +10,14 @@ class Search extends Eloquent {
if(is_null($search)){
return null;
}
// Retrieve all the ingredients that match the search query
$searchIngredients = Ingredient::where('name', 'LIKE', '%'.$search.'%')->get();
// Retrieve all the categories that match the search query
$searchCategory = Category::where('display_name', 'LIKE', '%'.$search.'%')->first();
// Retrieve all the recipies whose description and title match the search query
$searchRecipes = Recipe::where('title', 'LIKE', '%'.$search.'%')->orwhere('description', 'LIKE', '%'.$search.'%')->get();
// find all recipes that share an id with the search ingredients
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment