hipsterjazzbo / Landlord

A simple, single database multi-tenancy solution for Laravel 5.2+
MIT License
612 stars 142 forks source link

Issue with Laravel pagination #78

Closed imranalii closed 7 years ago

imranalii commented 7 years ago

Hi, I've just upgraded Laravel from 5.4 to 5.5, along with "Landlord" package but for some reasons Laravel pagination is not working.

Following call returns empty collection object.

$postsCollection = Post::where('post_type_id','=',1)->paginate(10);

If i remove use BelongsToTenants Trait from Model then pagination works fine.

Can you please look into this?

Thanks.

imranalii commented 7 years ago

For unknown reasons after updating Laravel project, I was unable to query some db tables.

Pagination was not working along with use BelongsToTenants Trait. But Eloquent get() was working fine.

After debugging for more than 6 hours, fixed it by just creating new database with same content.

Still not sure what caused this weird issue, but glad its fixed now.

Thanks.