Heres the output to the screen if I dd() in the render method
Illuminate\Support\Collection {#1355 ▼
#items: array:1 [▼
0 => {#1360 ▼
+"provider": "provider"
+"name": "name"
+"id": 2
+"price": 35.0
}
]
}
This is the ProductSelect Component class. ve tried...
- view('components.product-select',['products'=>$products]);
- view('components.product-select',compact('products'));
- view('components.product-select',['products'=>$products->toArray()]);
- view('components.product-select')->with(['products'=>$products->toArray()]);
and a few others
. Im confused cause the DD will send to screen.but when i was to use the variable in the view it doesn't pick it up..
public function render()
{
$products = $this->products->execute(['user_id'=> $this->userid,'att_id'=>$this->attid]);
dd($products);
return view('components.product-select')->with(['products'=>$products]);
}
product-select.blade here. Im trying to create another component with the output of products here..I don't think creating another component here matters because i can take out that bit of code with just an echo and nothing happens..
<div {{ $attributes->merge(['class' => 'modal-body row '. $classBody])}}>
@foreach ($products as $product)
<x-product-card
class="w-100"
:name="$product->name"
:description="$product->description"
:productid="$product->id"
:price="$product->price"
>
</x-product-card>
@endforeach
<div {{ $attributes->merge(['class' => 'modal-footer ' . $classFoot])}}>
{{ $buttons }}
</div>
Any thoughts?