pavlen
169
2
Laravel

Get pagination for full MySql and DB::select query

Posted 3 months ago by pavlen

Hi,

is there a way to use Laravel pagination in this situation :

Query for full mysql search :

   $key = ' test word';

   $q = DB::select(' SELECT * , MATCH(col 1,col 2) AGAINST ("'.$key.'" IN BOOLEAN MODE) AS score FROM test WHERE MATCH(col 1,col 2) AGAINST ("'.$key.'" IN BOOLEAN MODE)');

Query is ok, I get good results, but cant use clasic ->pagination() gett error, that can use pagination on array.

Thanks, Pavle

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.