mardi 11 octobre 2016

Laravel Chunk Method Using Eloquent

For processing large database, laravel provides chunk method as here http://ift.tt/2dHUqDn

But how can I use chunk method in this query,

 $data = Inspector::latest('id')
                ->select('id', 'firstname', 'status', 'state', 'phone')
                ->where('firstname', 'LIKE', '%' . $searchtext . '%')
                ->get();

where I'm returning json response like this,

echo json_encode($data);

Any suggestions....



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire