I am trying to use pagination in Laravel 4 with quite a complex query (using Fluent query builder I think).
Query SQL Code
SELECT `description`, `email`, `website`, `telephone`, `purpose`, `services`,
`eligibilitycriteria`, `meetingplace`, `servicecosts`, `area`,
`servicetype`, `beneficiarytype`, `charitynumber`, `address`, `contacts`,
MATCH (
`name`,`description`,`email`,`website`,`telephone`,`purpose`,`services`,
`eligibilitycriteria`,`meetingplace`,`servicecosts`,`area`,`servicetype`,
`beneficiarytype`,`charitynumber`,`address`,`contacts`
)
AGAINST ("dan") AS Score0,
MATCH (`name`) AGAINST ("dan") AS Score1 FROM `directory_cache`
WHERE MATCH(
`description`,`email`,`website`,`telephone`,`purpose`,`services`,
`eligibilitycriteria`,`meetingplace`,`servicecosts`,`area`,`servicetype`,
`beneficiarytype`,`charitynumber`,`address`,`contacts`
)
AGAINST ("dan")
ORDER BY (Score0*1 + Score1*1.5) DESC
I am calling the paginate at the end of the query builder in my controller like follows:
$results = $query->paginate(20);
Then in my view I simply call $results->links and I do get the pagination buttons for next page and the numbered pages etc.
But when I click on Page 2, this is where I encounter the problem.
My form uses POST to submit the search form. Both the get and post actions use the same view file to display the search form and results.
Please help and if you need any more information I am happy to edit the post and add it in, I am here all night!