PHPackages                             gawdl3y/asset-prefixer - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. gawdl3y/asset-prefixer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

gawdl3y/asset-prefixer
======================

Automatic asset path prefixes for Laravel

v1.1.1(12y ago)050MITPHPPHP &gt;=5.3.0

Since Mar 27Pushed 12y ago1 watchersCompare

[ Source](https://github.com/Gawdl3y/asset-prefixer)[ Packagist](https://packagist.org/packages/gawdl3y/asset-prefixer)[ RSS](/packages/gawdl3y-asset-prefixer/feed)WikiDiscussions master Synced 2mo ago

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

Laravel 4 Asset Prefixer
========================

[](#laravel-4-asset-prefixer)

This is a simple package that allows you to provide a prefix for asset paths, for things such as using AWS S3 for assets in production, but using local copies in development.

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

[](#installation)

Require this package in your composer.json and run `composer update` (or run `composer require gawdl3y/asset-prefixer:~1.0`):

```
"gawdl3y/asset-prefixer": "~1.0"

```

After installing the package, add the ServiceProvider to the providers array in app/config/app.php:

```
'Gawdl3y\AssetPrefixer\AssetPrefixerServiceProvider',

```

Also, add the facade to the aliases array:

```
'Asset' => 'Gawdl3y\AssetPrefixer\Asset',

```

Optionally, you may replace the HTML alias with it as well, since the AssetBuilder extends HtmlBuilder:

```
'HTML' => 'Gawdl3y\AssetPrefixer\Asset',

```

And finally, run `composer config:publish gawdl3y/asset-prefixer`

Usage
-----

[](#usage)

The AssetBuilder can be used as a drop-in replacement for HtmlBuilder by replacing the HTML facade alias. The methods are the same as the default ones provided by the HtmlBuilder class. The methods that AssetBuilder modifies to add the prefixes to are `script()`, `style()`, `image()`, `linkAsset()`, and `linkSecureAsset()`. Note that when using a prefix, `linkSecureAsset()` will not modify the protocol if you already provide it. I recommend using protocol-relative prefixes, like `//somecdn.net/`. This will use HTTP when you're viewing an HTTP page, and use HTTPS when viewing an HTTPS page.

The prefix is specified in the package's config file. Here's an example of usage and resulting output:

Prefix: `//somecoolcdn.com/`

View code:

```
{{ Asset::style('css/42.css') }}

```

Output:

```

```

When using as a drop-in replacement (you replaced the HTML facade alias), you can use `HTML::style('css/42.css')` to get the same result.

If you need to reference an asset with a full URL, you need to specify the final parameter for the script/style/image call to be `false`. Example:

```
{{ Asset::script('//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js', array(), null, false) }}

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

4

Last Release

4429d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/38f0e589cf477f406df9d8633c6ef116d702e56710c0766dee0cf22d4aad1769?d=identicon)[Gawdl3y](/maintainers/Gawdl3y)

---

Top Contributors

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

---

Tags

laravelassets

### Embed Badge

![Health badge](/badges/gawdl3y-asset-prefixer/health.svg)

```
[![Health](https://phpackages.com/badges/gawdl3y-asset-prefixer/health.svg)](https://phpackages.com/packages/gawdl3y-asset-prefixer)
```

###  Alternatives

[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7825.3M18](/packages/akaunting-laravel-money)[jasonlewis/resource-watcher

Simple PHP resource watcher library.

221145.8k14](/packages/jasonlewis-resource-watcher)[aedart/athenaeum

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

255.2k](/packages/aedart-athenaeum)[wearepixel/laravel-cart

A cart implementation for Laravel

1310.5k](/packages/wearepixel-laravel-cart)[efficiently/jquery-laravel

This package provides jQuery and the jQuery-ujs driver for your Laravel &gt;= 6 application.

1311.0k1](/packages/efficiently-jquery-laravel)

PHPackages © 2026

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