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

101PHPCI passing

Since May 14Pushed todayCompare

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

READMEChangelogDependenciesVersions (2)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

22

—

LowBetter than 21% of packages

Maintenance65

Regular maintenance activity

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 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.

### 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)")

### 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

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25025.5M80](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.2M6.5k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k20.0k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87930.4k113](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.3M83](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69122.6k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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