PHPackages                             sebdesign/laravel-sri - 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. sebdesign/laravel-sri

ActiveLibrary

sebdesign/laravel-sri
=====================

Subresource Integrity (SRI) package for Laravel

v2.2.3(3y ago)2339.7k1MITPHPPHP ^7.1|^8.0CI failing

Since Oct 25Pushed 3y ago3 watchersCompare

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

READMEChangelog (10)Dependencies (4)Versions (17)Used By (0)

Laravel SRI
===========

[](#laravel-sri)

Subresource Integrity (SRI) package for Laravel

[![Latest Version on Packagist](https://camo.githubusercontent.com/8f3010142fd7d70c32ae0240c9d5f1bda47e046d58de71e5864ad05b2142d5e7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73656264657369676e2f6c61726176656c2d7372692e737667)](https://packagist.org/packages/sebdesign/laravel-sri)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/23ef2ed5011d732106ea243566a8cc9db618367217020a7aa79cebdaa2eaf23e/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f73656264657369676e2f6c61726176656c2d7372692f6d61737465722e737667)](https://travis-ci.org/sebdesign/laravel-sri)[![StyleCI](https://camo.githubusercontent.com/829357664dfd7e656e7d088e5de325e6e00a2b3f17be85b4bf621b69ff1a697c/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f37313834323330302f736869656c64)](https://github.styleci.io/repos/71842300)

Reference and generate [Subresource Integrity (SRI)](https://www.w3.org/TR/SRI/) hashes from your Laravel Elixir asset pipeline.

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

[](#installation)

You can install the package via composer:

```
composer require sebdesign/laravel-sri
```

Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the service provider. If you don't use auto-discovery or you are using an older version, you must add the following:

```
// config/app.php
'providers' => [
    Sebdesign\SRI\SubresourceIntegrityServiceProvider::class,
];
```

Usage
-----

[](#usage)

This package is aimed to reference SRI hashes for `css` and `js` files from a `sri.json` file in your `/public` folder. In order to generate this file, see the [laravel-elixir-sri](https://github.com/sebdesign/laravel-elixir-sri) repository.

To reference the generated hashes from the `sri.json` in your views, you may use the `integrity` helper function with the name of the file you are using in your `elixir` or `asset` function.

As a fallback, if the given file is not found in the `sri.json`, **it will generate the appropriate hashes on the fly** for your convenience.

```
// Use with elixir() function

// Use with asset() function

```

If you have set the output folder for the `sri.json` in a different location in your Gulpfile, you can specify its `path` on the `config/sri.php`.

```
// config/sri.php
'path' => '/public/assets',
```

You can also override the config options by passing an array as a second argument on the `integrity` helper function:

```
// Use different hash algorithm

```

Testing
-------

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](./github/CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 86.2% 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 ~152 days

Recently: every ~266 days

Total

16

Last Release

1194d ago

Major Versions

v1.2.0 → v2.0.02019-09-02

PHP version history (4 changes)v1.1.0PHP ^5.6.4|^7.0

v1.2.0PHP ^7.0

v2.0.0PHP ^7.1

v2.2.1PHP ^7.1|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b6e1c3a91c80136e389a340c12a59940bb44cb8f56335516a7bad6b758f4c6d?d=identicon)[sebdesign](/maintainers/sebdesign)

---

Top Contributors

[![sebdesign](https://avatars.githubusercontent.com/u/667144?v=4)](https://github.com/sebdesign "sebdesign (25 commits)")[![devayes](https://avatars.githubusercontent.com/u/1299519?v=4)](https://github.com/devayes "devayes (2 commits)")[![stayallive](https://avatars.githubusercontent.com/u/1090754?v=4)](https://github.com/stayallive "stayallive (2 commits)")

---

Tags

laravellaravel-elixirlaravel-packagesrisubresource-integritylaravelsri

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sebdesign-laravel-sri/health.svg)

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

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3691.5k](/packages/codewithdennis-larament)

PHPackages © 2026

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