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. [API Development](/categories/api)
4. /
5. erashdan/laravelfastly

AbandonedArchivedLibrary[API Development](/categories/api)

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

A Laravel wrapper for Fastly SDK

v2.0.0(6y ago)44.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 2w 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 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

2373d ago

Major Versions

v1.2.0 → v2.0.02019-12-30

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16059897?v=4)[Emad Rashdan](/maintainers/erashdan)[@erashdan](https://github.com/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

[resend/resend-laravel

Resend for Laravel

1212.2M8](/packages/resend-resend-laravel)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

815320.5k3](/packages/defstudio-telegraph)[riclep/laravel-storyblok

A Laravel wrapper around the Storyblok API to provide a familiar experience for Laravel devs

6277.0k5](/packages/riclep-laravel-storyblok)[wayofdev/laravel-symfony-serializer

📦 Laravel wrapper around Symfony Serializer.

2116.2k](/packages/wayofdev-laravel-symfony-serializer)

PHPackages © 2026

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