Livewire says a property type is not supported when you paginate
Property type not supported in Livewire error while using paginate() methodShort answer
Livewire public properties only accept a limited set of types, and a paginator or query builder is not one of them. Do not store paginate() in a public property. Return it from a computed property or from render(), and use the WithPagination trait so the page links work.
Fix it fast
1Find out which cause you have
Find the public property that receives paginate() and note its assignment. A paginator stored on the component is the usual culprit.
grep -rn "paginate(" app/Livewire/2Match what you see, then jump to its fix
- 1
The error names the property that is assigned paginate() or a query builderA paginator is stored in a public propertyFix - 2
The property holds your own class, DTO or an Eloquent queryA custom class or query is stored on the componentFix - 3
A component that paginates but does not use the traitThe WithPagination trait is missingFix
- 1
What does the error look like?
Property type not supported in Livewire error while using paginate() methodProperty type not supported in Livewire
Cause 1 of 3
A paginator is stored in a public property
1Check
Livewire supports arrays, strings, integers, floats, booleans, null, and common PHP types such as Collection, Eloquent Collection, Model, DateTime, Carbon, Stringable and BackedEnum. Public properties are turned into JSON and back on each request, so other classes cannot be stored.
grep -rn "public \$" app/Livewire/ | grep -i "post\|users\|items"2Fix
Remove the public property. Return the paginator from a computed property and read it in the view as $this->posts.
use Livewire\Attributes\Computed;
use Livewire\WithPagination;
class ShowPosts extends Component
{
use WithPagination;
#[Computed]
public function posts()
{
return Post::paginate(10);
}
}3Verify
Load the component; the error is gone and the list renders.
php artisan view:clearConfirmed by livewire.laravel.com
Cause 2 of 3
A custom class or query is stored on the component
1Check
A custom class is not on the supported list. Livewire's route for custom classes is the Wireable interface, and for Eloquent data it recommends computed properties, because a stored collection re-runs its query when it is hydrated.
grep -rn "implements Wireable" app/2Fix
Make the class implement Wireable with toLivewire() and fromLivewire(), or keep only simple data in properties and compute the rest.
class Customer implements Wireable
{
public function toLivewire() { return ['name' => $this->name, 'age' => $this->age]; }
public static function fromLivewire($value) { return new static($value['name'], $value['age']); }
}3Verify
The component mounts without the property type error.
php artisan view:clearConfirmed by livewire.laravel.com
Cause 3 of 3
The WithPagination trait is missing
1Check
Each component that paginates must use the Livewire WithPagination trait.
grep -rn "WithPagination" app/Livewire/2Fix
Add the trait to the component class.
use Livewire\WithPagination;
class ShowPosts extends Component
{
use WithPagination;
}3Verify
Click the second page link; the list changes.
php artisan view:clearConfirmed by livewire.laravel.com
How do I stop it coming back?
- Keep public properties for small, simple state only; load data in computed properties.
- Remember that every public property is sent to the browser and back on each request.
- Add WithPagination as soon as a component paginates.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Back end
Composer says the gd extension is missing on a Laravel project
composer install or composer update stops on a package that requires ext-gd
Composer refuses to install a package that requires ext-gd when the PHP binary running Composer has no GD extension.
4 causes, each with a fixBack end
composer require maatwebsite/excel fails to install
Composer says the package needs an older PHP than the one installed
Composer refuses maatwebsite/excel when the PHP version or a PHP extension does not match what the package and PhpSpreadsheet need.
3 causes, each with a fixBack end
composer install says the lock file is not compatible and asks for update
Your lock file does not contain a compatible set of packages. Please run composer update.
composer install checked the locked packages against this machine's PHP and extensions and found a conflict.
3 causes, each with a fixBack end
composer require laravel/horizon fails: ext-pcntl is missing
laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system
Horizon needs the pcntl extension, and Composer refuses to install it where PHP lacks that extension.
3 causes, each with a fixBack end
composer require laravel/passport stops with 'requirements could not be resolved'
... but these were not loaded, likely because it conflicts with another require.
Composer found no Passport release that fits your project at once.
4 causes, each with a fixBack end
Composer says the root composer.json requires a PHP version your PHP does not satisfy
Your requirements could not be resolved to an installable set of packages.
Composer compares the php constraint in your composer.json, or in a package, with the PHP that runs Composer.
3 causes, each with a fix