FatalErrorException ERROR Call to a member function links() on string
i am trying to laravel pagination but when i am clicking on 2nd link above error is comming
here my controller
``
$searchResult = Property::where('purpose', $request['purpose'])
->whereHas('city', function ($qry) use ($cityName) {
$qry->where('name', 'like', $cityName);
})
->whereHas('catagory', function ($qry) use ($catagory) {
$qry->where('type', $catagory);
})->paginate(1);
What 2nd link? Do the pagination links get rendered for the first page?
It would seem that $data is not what you think, i.e. a string rather than an instance of Paginator; perhaps you are overwriting $data elsewhere? Maybe choose a more meaningful variable name for your Property results, e.g. $properties - you mught be less likely to accidentally overwrite this variable name.