Download

Are you tired of cooking the same meals over and over again? Are you looking to inject some excitement and creativity into your culinary endeavors? Look no further! We are thrilled to introduce our cutting-edge Random Recipe Generator built using Laravel, a powerful PHP framework. This innovative tool is designed to revolutionize the way you approach cooking, offering a seamless experience packed with features to inspire and delight.

Key Features:

  1. Recipe Description: Each recipe comes with a detailed description, providing insights into its origin, flavor profile, and cultural significance. Whether you're curious about the history behind a dish or eager to explore new flavors, our generator has you covered.

  2. Ingredients and Measurements: No more guessing or searching for elusive ingredients. Our generator provides a comprehensive list of ingredients along with precise measurements, ensuring that you have everything you need to recreate the recipe with ease.

  3. Video Tutorials: Visual learners rejoice! In addition to written instructions, many of our recipes are accompanied by video tutorials sourced from YouTube. Watch expert chefs in action as they guide you through the cooking process, offering valuable tips and techniques along the way.

  4. Customization Options: Tailor your culinary experience to suit your preferences. Filter recipes based on dietary restrictions, ingredient preferences, or cuisine types. Whether you're a vegetarian, gluten-free, or simply craving Italian cuisine, our generator has options to suit every palate.

 

Controller code

 

 public function fetchData(){

      try{

        $response =  Http::get("https://www.themealdb.com/api/json/v1/1/random.php");

        $datas = json_decode($response->body(),true);

         return view('data', compact('datas'));

      }catch(Exception $e){

        return $e->getMessage();

      } 

  }

Blade file

 

   @foreach ($datas as $data)

        @foreach ($data as $date)

            <div class="recipe-card">

                <aside >

                    <img src="{{ $date['strMealThumb'] }}" alt="Chai Oatmeal"  />

                </aside>

                <article>

                    <h2 style="margin-left:-2px;margin-bottom:4px;">{{ $date['strMeal'] }}</h2>

                    <h3>{{ $date['strCategory'] }}</h3>

                    <ul style="display: flex">

                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" style="width: 20px;height:20px;">

                            <!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M549.7 124.1c-6.3-23.7-24.8-42.3-48.3-48.6C458.8 64 288 64 288 64S117.2 64 74.6 75.5c-23.5 6.3-42 24.9-48.3 48.6-11.4 42.9-11.4 132.3-11.4 132.3s0 89.4 11.4 132.3c6.3 23.7 24.8 41.5 48.3 47.8C117.2 448 288 448 288 448s170.8 0 213.4-11.5c23.5-6.3 42-24.2 48.3-47.8 11.4-42.9 11.4-132.3 11.4-132.3s0-89.4-11.4-132.3zm-317.5 213.5V175.2l142.7 81.2-142.7 81.2z"/></svg>

                            <a href="{{ $date['strYoutube'] }}" style="margin-left: 7px;margin-top:4px;text-decoration:none;" target="_blank">

                                Watch in video tutorial

                            </a>

                        {{-- <li><span class="icon icon-level"></span><span>Beginner level</span></li>

                        <li><span class="icon icon-calories"></span><span>248</span></li> --}}

                    </ul>

                    <p>{{ preg_replace('/^d+s*/', '', $date['strInstructions']) }}</p>

                    <p class="ingredients">

                        <span>Ingredients:&nbsp;</span>{{ $date['strIngredient1'] . ', ' . $date['strIngredient2'] . ', ' . $date['strIngredient3'] . ', ' . $date['strIngredient4'] . ', ' . $date['strIngredient5'] . ', ' . $date['strIngredient6'] . ', ' . $date['strIngredient7'] . ', ' . $date['strIngredient8'] . ', ' . $date['strIngredient9'] . ', ' . $date['strIngredient10'] . ', ' . $date['strIngredient11'] }}

                    </p>

                    <p class="ingredients">

                        <span>Measurments:&nbsp;</span>{{ $date['strMeasure1'] . ', ' . $date['strMeasure2'] . ', ' . $date['strMeasure3'] . ', ' . $date['strMeasure4'] . ', ' . $date['strMeasure5'] . ', ' . $date['strMeasure6'] . ', ' . $date['strMeasure7'] . ', ' . $date['strMeasure8'] . ', ' . $date['strMeasure9'] . ', ' . $date['strMeasure10'] . ', ' . $date['strMeasure11'] }}

                    </p>

                </article>

            </div>

        @endforeach

    @endforeach