Livewire 3 Help
Error:
product-list.blade.php
Property type not supported in Livewire for property: [{"current_page":1,"data":[{"id":1,"name":"Alf.....Property type not supported in Livewire for property: [{"current_page":1,"data":[{"id":1,"name":"Alf.....<?php
namespace App\Livewire;
use App\Models\Product;
use Livewire\Component;
use Livewire\WithPagination;
class ProductList extends Component
{
use WithPagination;
public $products;
public function mount()
{
$this->products = Product::paginate(5);
}
public function render()
{
return view('livewire.product-list');
}
}<?php
namespace App\Livewire;
use App\Models\Product;
use Livewire\Component;
use Livewire\WithPagination;
class ProductList extends Component
{
use WithPagination;
public $products;
public function mount()
{
$this->products = Product::paginate(5);
}
public function render()
{
return view('livewire.product-list');
}
}product-list.blade.php
<div>
@foreach ($products as $product)
<div>
{{ $product->name }}
</div>
@endforeach
{{ $products->links() }}
</div><div>
@foreach ($products as $product)
<div>
{{ $product->name }}
</div>
@endforeach
{{ $products->links() }}
</div>