PHPackages                             erashdan/laravelfastly - 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. erashdan/laravelfastly

AbandonedArchivedLibrary

erashdan/laravelfastly
======================

A Laravel wrapper for Fastly SDK

v2.0.0(6y ago)64.5kMITPHPPHP &gt;=7.1.3

Since Jan 21Pushed 6y ago1 watchersCompare

[ Source](https://github.com/erashdan/laravel-fastly)[ Packagist](https://packagist.org/packages/erashdan/laravelfastly)[ RSS](/packages/erashdan-laravelfastly/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)Dependencies (4)Versions (5)Used By (0)

Fastly Laravel [![Build Status](https://camo.githubusercontent.com/4c0cdbe017acb64e0ed4160a8d3e4e519502de42ce6573186d1b660231476cbd/68747470733a2f2f7472617669732d63692e6f72672f657261736864616e2f6c61726176656c2d666173746c792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/erashdan/laravel-fastly)
===================================================================================================================================================================================================================================================================================================================

[](#fastly-laravel-)

- [Installation](#installation)
- [Usage](#usage)
- [Testing](#testing)
- [Credits](#credits)
- [Todo](#todo)

This is a wrapper around [Fastly SDK](https://github.com/fastly/fastly-php) for Laravel.

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

[](#installation)

This package can be used in Laravel 5.5 or higher.

You can install the package via composer:

```
composer require erashdan/laravelfastly
```

Laravel's package auto discovery will automatically register the service provider for you.

Then you need to publish the configuration to your project:

```
php artisan vendor:publish --provider="Erashdan\LaravelFastly\FastlyServiceProvider" --tag="config"
```

And add the key used for the hashing in .env file

```
FASTLY_API_KEY=GENERATE_KEY_FROM_FASTLY_ACCOUNT
```

Usage
-----

[](#usage)

You can clear the cache from fastly using the `Fastly` Facade

### Purge by URL

[](#purge-by-url)

```
Fastly::purgeUrl('get-url')
```

The facade also accept an array of URIs to be cleared

```
Fastly::purgeUrl(['first-url', 'second-url'])
```

### Purge by service id

[](#purge-by-service-id)

First you should define services array in configuration `fastly.php`

```
'services' => [
    'main' => 'xDp52XsJ5dXLp',
]
```

You can call `fastly` Facades to purge all files by service name.

```
Fastly::purgeService('main');
```

### Call method

[](#call-method)

You can request fastly service to cache a specific url by using `call` method

```
Fastly::callUrl('https://erashdan.com');
```

### Purge and call

[](#purge-and-call)

You can purge specific url and re-cache (`call`) it by using `purgeAndCall` method

```
Fastly::purgeAndCall('https://erashdan.com');
```

### Testing

[](#testing)

```
composer test
```

Credits
-------

[](#credits)

- [Emad Rashdan](https://github.com/erashdan)

TODO
----

[](#todo)

```
- [x] Build first version.
- [x] Purge by service ID
- [x] Call fastly `call` wrapper.
- [] Implement `call` using URI

```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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 ~114 days

Total

4

Last Release

2322d ago

Major Versions

v1.2.0 → v2.0.02019-12-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd0c51b44be0d628086bf857d75f4c0f309bc2b3d1c1825ad62df7d4c4e5f570?d=identicon)[erashdan](/maintainers/erashdan)

---

Top Contributors

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

---

Tags

phplaravelfastly

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/erashdan-laravelfastly/health.svg)

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

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M710](/packages/maatwebsite-excel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[monicahq/laravel-cloudflare

Add Cloudflare ip addresses to trusted proxies for Laravel.

3372.7M4](/packages/monicahq-laravel-cloudflare)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2031.2M2](/packages/glushkovds-phpclickhouse-laravel)[tzsk/otp

A secure, database-free One-Time Password (OTP) generator and verifier for PHP and Laravel.

241641.4k1](/packages/tzsk-otp)[kra8/laravel-snowflake

Snowflake for Laravel and Lumen.

188402.3k6](/packages/kra8-laravel-snowflake)

PHPackages © 2026

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