hamway/lcurl is a Laravel package for laravel package for work with curl.
It currently has 1 GitHub stars and 39 downloads on Packagist (latest version v2.0.2).
Install it with composer require hamway/lcurl.
Discover more Laravel packages by hamway
or browse all Laravel packages to compare alternatives.
Last updated
Author: Evgeny Anoykin [email protected]
A Laravel Curl library for get content via proxy or direct (support random user agents, random interval between requests).
Require this package with composer using the following command:
composer require hamway/lcurl
After updating composer, add the service provider to the providers array in config/app.php
'Hamway\LCurl\LCurlServiceProvider',
And alias
'LCurl' => 'Hamway\LCurl\Facades\LCurl',
After install library ready to use. But may be configure. For publish package config use command:
php artisan config:publish hamway/lcurl
Package configuration file example:
return array(
'timeout' => 50, // Max curl timeout
'userAgent' => true, // Generate useragent
'sleep' => [ // pause between requests in seconds
'min' => 0,
'max' => 0
],
'proxy' => false, // use proxy
'proxyList' => [ // proxy list
'118.97.194.49:8080'
]
);
Build url for request:
LCurl::buildUrl($url, array $query)
Get page content:
LCurl::get($url)
Get image from page (saveTo - path to image if need save):
LCurl::getImage($url, $saveTo)
lcurl is offered under the MIT license. See the LICENSE file.