PHPackages                             shinsenter/defer-laravel - 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. shinsenter/defer-laravel

AbandonedArchivedLibrary

shinsenter/defer-laravel
========================

🚀 A Laravel package that focuses on minimizing payload size of HTML document and optimizing processing on the browser when rendering the web page.

1.0.4(4y ago)184.8k↑250%2MITPHPPHP &gt;=5.6

Since Apr 14Pushed 4y ago3 watchersCompare

[ Source](https://github.com/shinsenter/defer-laravel)[ Packagist](https://packagist.org/packages/shinsenter/defer-laravel)[ Docs](https://github.com/shinsenter/defer-laravel)[ GitHub Sponsors](https://github.com/shinsenter/defer-laravel/stargazers)[ Patreon](https://www.patreon.com/shinsenter)[ RSS](/packages/shinsenter-defer-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (6)Versions (5)Used By (0)

shinsenter/defer-laravel
========================

[](#shinsenterdefer-laravel)

🚀 A Laravel package that focuses on minimizing payload size of HTML document and optimizing processing on the browser when rendering the web page.

- **Package**: [shinsenter/defer-laravel](https://packagist.org/packages/shinsenter/defer-laravel)
- **Version**: 1.0.3
- **Author**: Mai Nhut Tan
- **Copyright**: 2021 AppSeeds
- **License**: [MIT](https://raw.githubusercontent.com/shinsenter/defer-laravel/master/LICENSE)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d400a001f7f7a982a67521bf75693b1cb33b8d2a428a9c8a35612780e4d5c61a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7368696e73656e7465722f64656665722d6c61726176656c2e737667)](https://packagist.org/packages/shinsenter/defer-laravel)[![CodeFactor](https://camo.githubusercontent.com/15a35800c2883e21dc4feb135d048541d75dee668bbf66f574fdf8b95a48943e/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f7368696e73656e7465722f64656665722d6c61726176656c2f6261646765)](https://www.codefactor.io/repository/github/shinsenter/defer-laravel)[![Total Downloads](https://camo.githubusercontent.com/e316a1578e50ddba4fb6d9cf919292a898eb681db66d0d2d9fff0ea480d10369/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7368696e73656e7465722f64656665722d6c61726176656c2e737667)](https://packagist.org/packages/shinsenter/defer-laravel)

Features
--------

[](#features)

- Simplify library options
- Embed defer.js library
- Normalize DOM elements
- Fix missing meta tags
- Fix missing media attributes
- Preconnect to required origins
- Preload key requests
- Prefetch key requests
- Browser-level image lazy-loading for the web
- Lazy-load offscreen and hidden iframes
- Lazy-load offscreen and hidden videos
- Lazy-load offscreen and hidden images
- Lazy-load CSS background images
- Reduce the impact of JavaScript
- Defer non-critical CSS requests
- Defer third-party assets
- Add fallback `` tags for lazy-loaded objects
- Add custom HTML while browser is rendering the page (splashscreen)
- Attribute to ignore optimizing the element
- Attribute to ignore lazyloading the element
- Optimize AMP document
- Minify HTML output

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

[](#installation)

Require the `shinsenter/defer-laravel` package in your `composer.json` and update your dependencies:

```
composer require shinsenter/defer-laravel
```

Global usage
------------

[](#global-usage)

To allow `DeferMiddleware` for all of your routes, add the `DeferMiddleware` middleware at the top of the `$middleware` property of `app/Http/Kernel.php` class:

```
protected $middleware = [
  \AppSeeds\DeferLaravel\DeferMiddleware::class,
    // ...
];
```

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

[](#configuration)

The defaults are set in `config/defer-laravel.php`. Publish the config to copy the file to your own config:

```
php artisan vendor:publish --tag="defer-laravel"
```

### Options

[](#options)

View the [defer-laravel.php](https://github.com/shinsenter/defer-laravel/blob/master/config/defer-laravel.php)config file for more details.

### Lumen

[](#lumen)

On Lumen, just register the `DeferServiceProvider` manually in your `bootstrap/app.php` file:

```
$app->register(\AppSeeds\DeferLaravel\DeferServiceProvider::class);
```

Also copy the [defer-laravel.php](https://github.com/shinsenter/defer-laravel/blob/master/config/defer-laravel.php)config file to `config/defer-laravel.php` and put it into action:

```
$app->configure('defer-laravel');
```

Global usage for Lumen
----------------------

[](#global-usage-for-lumen)

To allow `DeferMiddleware` for all your routes, add the `DeferMiddleware` middleware to the global middleware.

```
$app->middleware([
    // ...
    \AppSeeds\DeferLaravel\DeferMiddleware::class,
]);
```

### Changelog

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING](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.

My works
--------

[](#my-works)

### Defer.js

[](#deferjs)

🥇 A super small, super efficient library that helps you lazy load almost everything like images, video, audio, iframes as well as stylesheets, and JavaScript.

### defer.php

[](#deferphp)

🚀 A PHP library that aims to help you concentrate on web performance optimization.

### Wordpress plugin

[](#wordpress-plugin)

⚡️ A native, blazing fast lazy loader. ✅ Legacy browsers support (IE9+). 💯 SEO friendly. 🧩 Lazy load almost anything.

Support my activities
---------------------

[](#support-my-activities)

[![Donate via Paypal](https://camo.githubusercontent.com/59139f7fde490eae3d203615321dc6ee3d41c9599f06afc3667ddc913d4a1f24/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d50617970616c2d626c7565)](https://www.paypal.me/shinsenter)[![Become a sponsor](https://camo.githubusercontent.com/8c323dbd0c7206991369959ac65c25373980644776706cf1dcdb40aa201b7e79/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d50617472656f6e2d6f72616e6765)](https://www.patreon.com/appseeds)[![Become a stargazer](https://camo.githubusercontent.com/c3d629f1a2eb6635b8aeb6df94411bc452f17d5f24ae5b02223cd39dc893a176/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f537570706f72742d5374617267617a65722d79656c6c6f77)](https://github.com/shinsenter/defer.php/stargazers)[![Report an issue](https://camo.githubusercontent.com/5bc2b0e7fc46bf61ff45da5e75960fea1de0c2e4a229899fbca8573151aaed70/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f537570706f72742d4973737565732d677265656e)](https://github.com/shinsenter/defer.php/issues/new)

---

From Vietnam 🇻🇳 with love.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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 ~18 days

Total

3

Last Release

1817d ago

PHP version history (2 changes)1.0.2PHP ^5.6|^7|^8

1.0.3PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c8b809d5ee939678c993eab96c03e8481edd09992d8455eab87c2c134fdbb7d?d=identicon)[shinsenter](/maintainers/shinsenter)

---

Top Contributors

[![shinsenter](https://avatars.githubusercontent.com/u/2082119?v=4)](https://github.com/shinsenter "shinsenter (16 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")[![egyjs](https://avatars.githubusercontent.com/u/12745270?v=4)](https://github.com/egyjs "egyjs (1 commits)")

---

Tags

core-web-vitalsdefer-phplaravellaravel-packagelazyloadlumenpagespeedperformanceshinsenterlaravellazy loadingperformancelumenlazyloaddefer.phplazyload imagelazyload videolazyload fontlazyload jslazyload cssloading lazyshinsenterdefer-laravel

### Embed Badge

![Health badge](/badges/shinsenter-defer-laravel/health.svg)

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

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[laravel/lumen-framework

The Laravel Lumen Framework.

1.5k26.2M709](/packages/laravel-lumen-framework)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[moonshine/moonshine

Laravel administration panel

1.3k217.1k59](/packages/moonshine-moonshine)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)

PHPackages © 2026

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