Level 47
This is the only sql query in your code:
FoodList::where('illness', $sickness)->get();
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
how do I convert this $food_list->recipe to php?
$sickness = Highblood;
$list = FoodList::where('illness', $sickness)->get();
How to do this? in my sql.
@foreach($list as $food_list)
<p> <h4> {{ $food_list->name }} </h4> </p>
<strong> <h5> Ingridients </h5> </strong>
{{ $food_list->recipe }} //convert this to sql query
<strong> <h5> Directions </h5> </strong>
{{ $food_list->directions }} //convert this to sql query
@endforeach
My table structure
Please or to participate in this conversation.