app\models\Recipe::getProjects PHP Method

getProjects() public method

public getProjects ( )
    public function getProjects()
    {
        return $this->projects()->orderBy('name')->get();
    }

Usage Example

コード例 #1
0
ファイル: RecipesController.php プロジェクト: ngmy/webloyer
 /**
  * Display the specified resource.
  *
  * @param \App\Models\Recipe $recipe
  * @return Response
  */
 public function show(Recipe $recipe)
 {
     $recipeProject = $recipe->getProjects()->toArray();
     return view('recipes.show')->with('recipe', $recipe)->with('recipeProject', $recipeProject);
 }