Answers for "get data from model in chunks laravel"

PHP
0

get data from model in chunks laravel

$data = Inspector::latest('id')
    ->select('id', 'firstname', 'status', 'state', 'phone')
    ->where('firstname', 'LIKE', '%' . $searchtext . '%')
    ->chunk(50, function($inspectors) {
        foreach ($inspectors as $inspector) {
            // apply some action to the chunked results here
        }
    });
Posted by: Guest on December-11-2020

Code answers related to "get data from model in chunks laravel"

Browse Popular Code Answers by Language