PHPackages                             tanedaa/laravel-webshare - 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. tanedaa/laravel-webshare

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

tanedaa/laravel-webshare
========================

A small package that integrates webshare.io proxies into Laravel

v1.0.1(2mo ago)072↓50%MITPHP ^8.1

Since May 8Compare

[ Source](https://github.com/tanedaa/laravel-webshare)[ Packagist](https://packagist.org/packages/tanedaa/laravel-webshare)[ RSS](/packages/tanedaa-laravel-webshare/feed)WikiDiscussions Synced 3w ago

READMEChangelogDependencies (6)Versions (2)Used By (0)

Laravel WebShare
================

[](#laravel-webshare)

Laravel package for integrating [webshare.io](https://www.webshare.io/) proxies into your Laravel application.

It supports:

- Syncing purchased proxies from WebShare into your database
- Using a random valid proxy in outgoing Laravel HTTP requests via `Http::webshare()`
- Accessing random proxy data/URL for other clients

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10+

Installation
------------

[](#installation)

```
composer require tanedaa/laravel-webshare
```

Publish Assets
--------------

[](#publish-assets)

Publish both config and migrations:

```
php artisan vendor:publish --tag=webshare
```

Or publish separately:

```
php artisan vendor:publish --tag=webshare-config
php artisan vendor:publish --tag=webshare-migrations
```

Run migrations:

```
php artisan migrate
```

Configuration
-------------

[](#configuration)

Set your WebShare API key in `.env`:

```
WEBSHARE_API_KEY=your_webshare_api_key
WEBSHARE_API_URL=https://proxy.webshare.io/api/v2/
WEBSHARE_PROXY_TABLE=webshare_proxies
WEBSHARE_TIMEOUT=10
WEBSHARE_CONNECT_TIMEOUT=5
WEBSHARE_RETRY_TIMES=2
WEBSHARE_RETRY_SLEEP_MILLISECONDS=250
```

Config file: `config/webshare.php`

Custom API hosts are rejected by default. If you intentionally point the package at a non-WebShare host, set `WEBSHARE_ALLOW_CUSTOM_API_URL=true`.

Sync Proxies
------------

[](#sync-proxies)

Use the built-in command:

```
php artisan webshare:update-proxies
```

Optional page size:

```
php artisan webshare:update-proxies --page-size=200
```

The command paginates through WebShare API results until all purchased proxies are fetched, then upserts them into the configured proxy table. By default, that table is `webshare_proxies`.

Scheduling
----------

[](#scheduling)

Laravel 11+ (`routes/console.php`):

```
use Illuminate\Support\Facades\Schedule;

Schedule::command('webshare:update-proxies --page-size=100')->hourly();
```

Laravel 10 (`app/Console/Kernel.php` inside `schedule()`):

```
$schedule->command('webshare:update-proxies --page-size=100')->hourly();
```

Usage
-----

[](#usage)

### 1. Laravel HTTP Client Macro

[](#1-laravel-http-client-macro)

Use a random valid proxy automatically:

```
use Illuminate\Support\Facades\Http;

$response = Http::webshare()->get('https://api.ipify.org?format=json');
```

You can still chain regular HTTP options:

```
$response = Http::timeout(15)->webshare()->get('https://httpbin.org/ip');
```

### 2. Facade

[](#2-facade)

```
use Tanedaa\LaravelWebShare\Facades\WebShare;

$proxyUrl = WebShare::getRandomProxyUrl();
$proxyData = WebShare::getRandomProxyData();
$proxyCredentials = WebShare::getRandomProxyCredentials();
```

`getRandomProxyData()` returns safe proxy metadata without credentials:

```
[
    'proxy_id' => '...',
    'address' => 'host:port',
    'ip' => 'host',
    'port' => 1234,
    'is_valid' => true,
    'country_code' => '...',
    'city_name' => '...',
    'asn_name' => '...',
    'asn_number' => '...',
]
```

`getRandomProxyCredentials()` is available when a non-Laravel HTTP client needs explicit credentials:

```
[
    'address' => 'host:port',
    'ip' => 'host',
    'port' => 1234,
    'username' => '...',
    'password' => '...',
    'proxy_url' => 'http://user:pass@host:port',
]
```

Proxy passwords are stored using Laravel's encrypted Eloquent cast and are hidden when the proxy model is serialized.

### 3. Dependency Injection

[](#3-dependency-injection)

```
use Tanedaa\LaravelWebShare\Services\WebShare;

public function __invoke(WebShare $webShare)
{
    return $webShare->getRandomProxyData();
}
```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance85

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

77d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/28830695?v=4)[Taneda](/maintainers/tanedaa)[@tanedaa](https://github.com/tanedaa)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tanedaa-laravel-webshare/health.svg)

```
[![Health](https://phpackages.com/badges/tanedaa-laravel-webshare/health.svg)](https://phpackages.com/packages/tanedaa-laravel-webshare)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M133](/packages/roots-acorn)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k96.5k1](/packages/mike-bronner-laravel-model-caching)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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