PHPackages                             zeydkazanci03/laracurl - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. zeydkazanci03/laracurl

ActiveLibrary[HTTP &amp; Networking](/categories/http)

zeydkazanci03/laracurl
======================

Laravel için gelişmiş ve kullanımı kolay Curl paketi

v3.0(6mo ago)015MITPHPPHP ^8.1

Since Oct 26Pushed 6mo agoCompare

[ Source](https://github.com/zeydkazanci03/laracurl)[ Packagist](https://packagist.org/packages/zeydkazanci03/laracurl)[ RSS](/packages/zeydkazanci03-laracurl/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

LaraCurl
========

[](#laracurl)

Laravel 10+ için güçlü ve kullanımı kolay Curl paketi.

Özellikler
----------

[](#özellikler)

- ✅ Tüm HTTP metodları (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS)
- ✅ Fluent API ile kolay kullanım
- ✅ JSON, Form Data, Multipart desteği
- ✅ Dosya yükleme
- ✅ Bearer Token ve Basic/Digest Authentication
- ✅ Proxy desteği
- ✅ Cookie yönetimi
- ✅ SSL doğrulama kontrolü
- ✅ Header yönetimi
- ✅ Timeout ayarları
- ✅ Yönlendirme kontrolü
- ✅ Response helper metodları
- ✅ Laravel Facade desteği

Kurulum
-------

[](#kurulum)

Composer ile paketi yükleyin:

```
composer require zeydkazanci03/laracurl
```

Laravel 10+ için otomatik olarak servis sağlayıcı kaydedilir.

### Config Dosyasını Yayınlama (Opsiyonel)

[](#config-dosyasını-yayınlama-opsiyonel)

```
php artisan vendor:publish --tag=laracurl-config
```

Temel Kullanım
--------------

[](#temel-kullanım)

### GET İsteği

[](#get-i̇steği)

```
use Curl;

// Basit GET isteği
$response = Curl::get('https://api.example.com/users');
echo $response->response();

// Query parametreleri ile
$response = Curl::get('https://api.example.com/users', [
    'page' => 1,
    'limit' => 10
]);

// JSON olarak al
$data = $response->json();
```

### POST İsteği

[](#post-i̇steği)

```
// JSON gönderme
$response = Curl::post('https://api.example.com/users')
    ->json([
        'name' => 'Zeyd Kazancı',
        'email' => 'zeyd@example.com'
    ])
    ->response();

// Form data gönderme
$response = Curl::post('https://api.example.com/login')
    ->form([
        'username' => 'zeyd',
        'password' => 'secret'
    ])
    ->response();
```

### PUT/PATCH İsteği

[](#putpatch-i̇steği)

```
$response = Curl::put('https://api.example.com/users/1')
    ->json([
        'name' => 'Yeni İsim'
    ])
    ->response();

$response = Curl::patch('https://api.example.com/users/1')
    ->json([
        'email' => 'yeni@example.com'
    ])
    ->response();
```

### DELETE İsteği

[](#delete-i̇steği)

```
$response = Curl::delete('https://api.example.com/users/1');

if ($response->successful()) {
    echo "Başarıyla silindi";
}
```

Gelişmiş Kullanım
-----------------

[](#gelişmiş-kullanım)

### Header Yönetimi

[](#header-yönetimi)

```
$response = Curl::get('https://api.example.com/data')
    ->header('X-Custom-Header', 'value')
    ->headers([
        'X-Another-Header' => 'value',
        'X-Third-Header' => 'value'
    ])
    ->response();
```

### Authentication

[](#authentication)

#### Bearer Token

[](#bearer-token)

```
$response = Curl::get('https://api.example.com/protected')
    ->bearerToken('your-token-here')
    ->response();
```

#### Basic Authentication

[](#basic-authentication)

```
$response = Curl::get('https://api.example.com/protected')
    ->basicAuth('username', 'password')
    ->response();
```

#### Digest Authentication

[](#digest-authentication)

```
$response = Curl::get('https://api.example.com/protected')
    ->digestAuth('username', 'password')
    ->response();
```

### Dosya Yükleme

[](#dosya-yükleme)

```
$response = Curl::post('https://api.example.com/upload')
    ->attach('file', '/path/to/file.jpg', 'image/jpeg')
    ->attach('document', '/path/to/document.pdf')
    ->response();

// Ek form verileri ile
$response = Curl::post('https://api.example.com/upload')
    ->attach('avatar', '/path/to/avatar.jpg')
    ->multipart([
        'user_id' => 123,
        'description' => 'Profil fotoğrafı'
    ])
    ->response();
```

### Timeout Ayarları

[](#timeout-ayarları)

```
$response = Curl::get('https://api.example.com/slow-endpoint')
    ->timeout(60) // 60 saniye
    ->connectTimeout(10) // Bağlantı için 10 saniye
    ->response();
```

### SSL Doğrulama

[](#ssl-doğrulama)

```
// SSL doğrulamayı kapat (development için)
$response = Curl::get('https://self-signed-cert.example.com')
    ->sslVerify(false)
    ->response();
```

### Proxy Kullanımı

[](#proxy-kullanımı)

```
$response = Curl::get('https://api.example.com/data')
    ->proxy('proxy.example.com', 8080)
    ->response();

// Authentication ile
$response = Curl::get('https://api.example.com/data')
    ->proxy('proxy.example.com', 8080, 'username', 'password')
    ->response();
```

### Cookie Yönetimi

[](#cookie-yönetimi)

```
// Cookie ekleme
$response = Curl::get('https://example.com')
    ->cookie('session_id', 'abc123')
    ->cookie('user_token', 'xyz789')
    ->response();

// Cookie dosyası kullanma
$response = Curl::get('https://example.com')
    ->cookieFile('/path/to/cookies.txt')
    ->response();
```

### Yönlendirme Kontrolü

[](#yönlendirme-kontrolü)

```
// Yönlendirmeleri takip etme
$response = Curl::get('https://example.com/redirect')
    ->followRedirects(true, 10) // Maksimum 10 yönlendirme
    ->response();

// Yönlendirmeleri devre dışı bırakma
$response = Curl::get('https://example.com/redirect')
    ->followRedirects(false)
    ->response();
```

### User Agent ve Referer

[](#user-agent-ve-referer)

```
$response = Curl::get('https://example.com')
    ->userAgent('MyCustomBot/1.0')
    ->referer('https://google.com')
    ->response();
```

### Custom CURL Options

[](#custom-curl-options)

```
$response = Curl::get('https://example.com')
    ->setOption(CURLOPT_ENCODING, 'gzip')
    ->setOptions([
        CURLOPT_BUFFERSIZE => 4096,
        CURLOPT_FRESH_CONNECT => true
    ])
    ->response();
```

Response Metodları
------------------

[](#response-metodları)

### Response Body

[](#response-body)

```
$response = Curl::get('https://api.example.com/data');

// Ham response
$body = $response->response();

// JSON olarak
$data = $response->json();

// Obje olarak
$object = $response->object();

// String olarak
$string = (string) $response;
```

### Status Kontrolü

[](#status-kontrolü)

```
$response = Curl::get('https://api.example.com/data');

// HTTP status code
$statusCode = $response->status(); // 200, 404, 500, vb.

// Başarılı mı? (2xx)
if ($response->successful()) {
    echo "Başarılı!";
}

// Başarısız mı?
if ($response->failed()) {
    echo "Başarısız!";
}

// Client hatası mı? (4xx)
if ($response->clientError()) {
    echo "Client hatası";
}

// Server hatası mı? (5xx)
if ($response->serverError()) {
    echo "Server hatası";
}
```

### Request Bilgileri

[](#request-bilgileri)

```
$response = Curl::get('https://api.example.com/data');

// Tüm bilgiler
$info = $response->info();

// Belirli bir bilgi
$totalTime = $response->info('total_time');
$downloadSize = $response->info('size_download');

// Response header'ları
$headers = $response->headers();
```

### Hata Yönetimi

[](#hata-yönetimi)

```
$response = Curl::get('https://api.example.com/data');

if ($response->failed()) {
    $errorMessage = $response->error();
    $errorNumber = $response->errno();

    echo "Hata: $errorMessage (Kod: $errorNumber)";
}
```

### Dosyaya Kaydetme

[](#dosyaya-kaydetme)

```
$response = Curl::get('https://example.com/file.pdf');

// Dosyaya kaydet
$response->save('/path/to/save/file.pdf');

// Tarayıcıdan indir
$response->download('my-file.pdf');
```

Zincirleme Kullanım (Method Chaining)
-------------------------------------

[](#zincirleme-kullanım-method-chaining)

```
$response = Curl::post('https://api.example.com/data')
    ->bearerToken('your-token')
    ->header('X-Custom-Header', 'value')
    ->timeout(30)
    ->sslVerify(false)
    ->json([
        'key' => 'value'
    ]);

if ($response->successful()) {
    $data = $response->json();
    // İşlemler...
}
```

Facade Olmadan Kullanım
-----------------------

[](#facade-olmadan-kullanım)

```
use ZeydKazanci03\LaraCurl\CurlManager;

$curl = new CurlManager();
$response = $curl->get('https://api.example.com/data');
```

Bağımlılık Enjeksiyonu
----------------------

[](#bağımlılık-enjeksiyonu)

```
use ZeydKazanci03\LaraCurl\CurlManager;

class UserService
{
    protected $curl;

    public function __construct(CurlManager $curl)
    {
        $this->curl = $curl;
    }

    public function getUsers()
    {
        return $this->curl
            ->get('https://api.example.com/users')
            ->json();
    }
}
```

Örnekler
--------

[](#örnekler)

### API'den Veri Çekme

[](#apiden-veri-çekme)

```
use Curl;

$response = Curl::get('https://jsonplaceholder.typicode.com/posts/1');

if ($response->successful()) {
    $post = $response->json();
    echo $post['title'];
}
```

### API'ye Veri Gönderme

[](#apiye-veri-gönderme)

```
$response = Curl::post('https://jsonplaceholder.typicode.com/posts')
    ->json([
        'title' => 'Yeni Post',
        'body' => 'Post içeriği',
        'userId' => 1
    ]);

if ($response->successful()) {
    $newPost = $response->json();
    echo "Yeni post ID: " . $newPost['id'];
}
```

### Kimlik Doğrulama ile İstek

[](#kimlik-doğrulama-ile-i̇stek)

```
$response = Curl::get('https://api.github.com/user')
    ->bearerToken('your-github-token');

if ($response->successful()) {
    $user = $response->json();
    echo "Merhaba, " . $user['name'];
}
```

### Dosya İndirme

[](#dosya-i̇ndirme)

```
$response = Curl::get('https://example.com/large-file.zip')
    ->timeout(300); // 5 dakika

if ($response->successful()) {
    $response->save(storage_path('downloads/file.zip'));
    echo "Dosya indirildi!";
}
```

### Form ile Dosya Yükleme

[](#form-ile-dosya-yükleme)

```
$response = Curl::post('https://api.example.com/upload')
    ->attach('image', storage_path('temp/photo.jpg'), 'image/jpeg')
    ->multipart([
        'title' => 'Tatil Fotoğrafı',
        'description' => '2024 yaz tatili',
        'category' => 'personal'
    ]);

if ($response->successful()) {
    echo "Dosya yüklendi!";
}
```

Lisans
------

[](#lisans)

MIT License

Destek
------

[](#destek)

Herhangi bir sorun veya öneriniz için GitHub'da issue açabilirsiniz.

Geliştirici
-----------

[](#geliştirici)

**Zeyd Kazancı**

- GitHub: [@zeydkazanci03](https://github.com/zeydkazanci03)

---

**LaraCurl** ile Laravel projelerinizde HTTP isteklerini kolayca yönetin! 🚀

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance68

Regular maintenance activity

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

3

Last Release

187d ago

Major Versions

v1.0 → v2.02025-11-01

v2.0 → v3.02025-11-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/95f426569d5737f78ab1dcb5c41dfa33afdd899eeda7508922c8d4efa6e6d3aa?d=identicon)[zeydkazanci03](/maintainers/zeydkazanci03)

---

Top Contributors

[![zeydkazanci03](https://avatars.githubusercontent.com/u/240235651?v=4)](https://github.com/zeydkazanci03 "zeydkazanci03 (4 commits)")

---

Tags

httprequestlaravelcurlzeydkazanci03

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zeydkazanci03-laracurl/health.svg)

```
[![Health](https://phpackages.com/badges/zeydkazanci03-laracurl/health.svg)](https://phpackages.com/packages/zeydkazanci03-laracurl)
```

###  Alternatives

[aplus/http-client

Aplus Framework HTTP Client Library

2161.6M1](/packages/aplus-http-client)[pear/http_request2

Provides an easy way to perform HTTP requests.

764.2M48](/packages/pear-http-request2)[vinelab/http

An http library developed for the laravel framework. aliases itself as HttpClient

59300.2k11](/packages/vinelab-http)[laravel-shift/curl-converter

A command line tool to convert curl requests to Laravel HTTP requests.

935.3k](/packages/laravel-shift-curl-converter)[jigarakatidus/laravel-http-to-curl

Extended Http to dump and die with Curl command

3060.6k](/packages/jigarakatidus-laravel-http-to-curl)[chelout/laravel-http-logger

A Laravel package to log HTTP requests, headers and sessions

272.0k](/packages/chelout-laravel-http-logger)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
