PHPackages                             prerender/laravel-prerender - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. prerender/laravel-prerender

ActiveLibrary[HTTP &amp; Networking](/categories/http)

prerender/laravel-prerender
===========================

Laravel middleware for prerendering JavaScript-rendered pages via Prerender.io

v1.0.0(1mo ago)111MITPHPPHP ^8.2CI passing

Since May 14Pushed 1mo agoCompare

[ Source](https://github.com/prerender/laravel)[ Packagist](https://packagist.org/packages/prerender/laravel-prerender)[ Docs](https://github.com/prerender/laravel)[ RSS](/packages/prerender-laravel-prerender/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (6)Versions (3)Used By (0)

prerender-laravel
=================

[](#prerender-laravel)

Laravel middleware for [Prerender.io](https://prerender.io). Intercepts requests from bots and crawlers and serves prerendered HTML, so your JavaScript-rendered app is fully indexable by search engines and social media scrapers.

Compatible with **Laravel 11+** and **PHP 8.2+**.

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

[](#installation)

```
composer require prerender/laravel-prerender
```

Publish the config file:

```
php artisan vendor:publish --tag=prerender-config
```

Setup
-----

[](#setup)

Add your token to `.env`:

```
PRERENDER_TOKEN=your-token
```

The middleware registers itself automatically via the service provider.

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

[](#configuration)

KeyEnv varDefaultDescription`enable``PRERENDER_ENABLE``true`Disable entirely (e.g. local dev)`prerender_url``PRERENDER_SERVICE_URL``https://service.prerender.io`Service URL (override for self-hosted)`prerender_token``PRERENDER_TOKEN``null`Your Prerender.io token`prerender_soft_http_codes``PRERENDER_SOFT_HTTP_STATUS_CODES``true`Pass 3xx/404 codes through as-is`full_url``PRERENDER_FULL_URL``false`Send full URL including query string`timeout``PRERENDER_TIMEOUT``0`Guzzle timeout in seconds (0 = none)### Whitelist / Blacklist

[](#whitelist--blacklist)

Only prerender URLs matching the whitelist (empty = all URLs pass):

```
'whitelist' => ['/blog/*', '/product/*'],
```

Never prerender URLs matching the blacklist (static assets are blacklisted by default):

```
'blacklist' => ['*.js', '*.css', '/admin/*'],
```

Patterns support `*` wildcards. Blacklist patterns are matched with the query string stripped, so `*.woff2` also matches `/font.woff2?v=3`.

How it works
------------

[](#how-it-works)

Requests are prerendered when **all** of the following are true:

- The HTTP method is `GET`
- The `User-Agent` matches a known bot/crawler (Googlebot, Bingbot, Twitterbot, GPTBot, ClaudeBot, etc.)
    — OR the URL contains `_escaped_fragment_`
    — OR the `X-BUFFERBOT` header is present
- The URI is not blacklisted (static assets are excluded by default)
- The URI matches the whitelist (if configured)

If the Prerender service is unreachable, the middleware falls back gracefully.

License
-------

[](#license)

MIT

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance91

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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

Unknown

Total

1

Last Release

45d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b28b3e58a26b523927c904276cd779b300e14dce7b299b2e360d8ff42f9c799d?d=identicon)[laslo-prerender](/maintainers/laslo-prerender)

---

Top Contributors

[![marcin-prerender](https://avatars.githubusercontent.com/u/253324589?v=4)](https://github.com/marcin-prerender "marcin-prerender (2 commits)")[![Lasalot](https://avatars.githubusercontent.com/u/61053418?v=4)](https://github.com/Lasalot "Lasalot (1 commits)")

---

Tags

middlewarelaravelprerenderseoprerender.io

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k113.1M962](/packages/laravel-socialite)[moonshine/moonshine

Laravel administration panel

1.3k268.2k86](/packages/moonshine-moonshine)[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.5k26.0M739](/packages/laravel-boost)[spatie/laravel-export

Create a static site bundle from a Laravel app

679153.2k6](/packages/spatie-laravel-export)[spatie/laravel-health

Monitor the health of a Laravel application

88212.7M180](/packages/spatie-laravel-health)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21667.3M1.9k](/packages/drupal-core)

PHPackages © 2026

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