Property type not supported in Livewire error while using paginate() method

Property type not supported in Livewire error while using paginate() method

  1. Blog
  2. 15 November 2026
  3. 4 min read

Stefan Bogdanescu

Founder & Senior Architect

Property Type Not Supported Error When Using Pagination in Livewire

You are encountering a specific Livewire limitation regarding how data is passed from your controller to a component. The error "Property type not supported in Livewire" occurs because you are passing the $items collection directly into the Livewire component via the @livewire directive, while simultaneously trying to manage pagination inside that same component.

In your ProductController, you pass $items (a standard Laravel Collection) as a property to the product.show component:

@livewire('product.show', ['items' => $items])

Inside the Show component, you have declared this public property:

public $products, $items, $name, $unit, $category, ...;

The core issue lies in Livewire's data binding mechanism. When you pass $items from the controller, Livewire attempts to map it to the App\Livewire\Product\Show class. However, Livewire has strict rules about which properties can be passed this way. Specifically, Livewire does not allow passing collection types or complex objects as direct properties if those properties are also intended to be managed by the component's internal logic (like pagination).

When you use paginate(2) inside the render() method of your component, Livewire expects $products to be a result of a query executed within the component itself. It manages the state of that collection internally. By passing an external $items variable in the same property declaration list as $products, or even if they were separate, Livewire often throws this error because it cannot determine how to serialize/deserialize the incoming collection alongside its own internal paginated query results during the update cycle.

The Fix: Remove External Data Passing

The solution is to stop passing data from the controller that is intended to be managed or queried within the component. Your controller's index method currently looks like this:

public function index()
{
    $items = Category::all();
    return view('product', compact('items'));
}

You should remove $items from the view data entirely if the Livewire component does not strictly require it as a pre-populated list for dropdowns or similar. If you need categories to appear in the table (as seen in your blade template: {{ $product->categories->pluck('name')->implode(', ') }}), ensure that relationship loading happens within the component's query or is handled via eager loading, not passed as a raw property from the controller.

Update your view to pass no data related to the main table logic:

@livewire('product.show')

And update your Livewire component to handle all necessary data internally:

namespace App\Livewire\Product;

use Livewire\Component;
use Illuminate\Support\Str;
use App\Models\Category;
use Livewire\WithPagination;
use App\Models\Product;

class Show extends Component
{
    use WithPagination;

    // Only declare properties that the component manages or initializes internally
    public $products, $name, $unit, $category, $price, $percentage, $discount;
    public $start_date, $end_date, $tax_percentage, $tax_amount, $net_price, $stock_quantity;
    
    // Keep UI state properties here
    public $listMode = true;
    public $updateMode = false;
    public $selectedCategories = [];

    public $sortBy = 'name';
    public $sortDirection = 'asc';

    public function render()
    {
        // Load categories inside the component if needed for relationships
        // Ensure you eager load categories to avoid N+1 issues
        $this->products = Product::with('categories')
            ->orderBy($this->sortBy, $this->sortDirection)
            ->paginate(2);

        return view('livewire.product.show');
    }
}

Why This Works

By removing $items from the @livewire directive arguments, you eliminate the conflict between external data binding and Livewire's internal state management. The WithPagination trait expects to own the lifecycle of the paginated collection. When you pass a collection from the controller, Livewire tries to merge it with its own internal state logic in a way that breaks serialization for complex types like Collections or Query Builders.

Additionally, notice the removal of $items from the public properties list in the component. If you do not need it, do not declare it. If you do need it for something specific (like filtering), initialize it inside the component's constructor or render() method rather than relying on controller injection.

Handling Relationships Correctly

In your blade template, you access categories via $product->categories. Since your original query did not eager load this relationship, Livewire might trigger a separate query for every page item. While pagination reduces the total number of items rendered per request, it does not prevent N+1 queries if relationships are missing.

Ensure your component's render() method includes eager loading:

$products = Product::with(['categories']) // Eager load categories
    ->orderBy($this->sortBy, $this->sortDirection)
    ->paginate(2);

This approach ensures that when you iterate over $products in your view, the category data is already attached, maintaining performance and adhering to Livewire's expectations for paginated datasets.

Our network