vendredi 16 octobre 2015

Get all results before paginate() i Laravel 5.1

Is it possible to get all query results before paginate it.

$results = Cars::select('cars.*', 'car_images.*') ... ->paginate(10);

This query return 1000+ results but pagination show only 10. I want to get all cars.id's which I can use in other query to show all possible parameters for 1000+ cars from result.

Cars

id  |  brand | model | year |

Parameters

id  |  param_name 
---------------------
1   |  color
2   |  fuel

Car_parameters

car_id  | param_id | param_value 
---------------------------------
1       |  1       | red
1       |  2       | diesel

If there is a better solution I would love to hear



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire