php - Fetch large amount of data in laravel 4.2 -
i have developed bulk sms sending software. software send millions of sms per day. want make report millions of data. cant fetch data. fetch 27000 row or less. apply query 2 fields id , mobile number. when try raw php code in other application works fine laravel can not fetch data. show memory size exhausted error. in php.ini memory limit 128m now want know best way fetch millions of data in laravel. or should implement other technology. you can use chunk method. user::chunk(200, function($users) { foreach ($users $user) { // } }); if need process lot (thousands) of eloquent records, using chunk command allow without using of ram. or you can run composer update no memory limit , can in following way php -d memory_limit=-1 composer update