I tried to fix this but don't know how
public function render()
{
return view('livewire.home')->extends('layouts.app')->section('content'),[
'products' => Product::take(3)->get()
];
It said that the syntax is error,
unexpected ',', expecting ';'
I'm newbie to Laravel so I couldn't write the correct syntax. Please let me know.
As you can see in the docs, to pass variables to the view, you need to set the second parameter in the method view()
as the array of data.
public function render()
{
return view('livewire.home', [
'products' => Product::take(3)->get()
])->extends('layouts.app')->section('content');
}