Closed atta1234 closed 3 years ago
I suspect the SQL for handling the withAllTags
method doesn't play nicely with Laravel's SQL for calculating pagination counts. Let me look into it.
The test I added above is pretty much a copy of your code, and it seems to work:
public function testWithAllTagsPaginated(): void
{
/** @var \Illuminate\Pagination\LengthAwarePaginator $models */
$models = TestModel::withAllTags('Apple,Banana')->paginate(2);
$this->assertCount(2, $models->items());
$this->assertEquals(3, $models->total());
}
Your issue might be related to strict mode in MySQL. See https://github.com/cviebrock/eloquent-taggable/issues/60#issuecomment-330493812 Can you confirm that setting in your database config?
Closing due to no response. Feel free to re-open or comment if you are still having issues.