How do I integrate Prerender with Laravel?
Make your Laravel application's JavaScript-rendered pages fully readable by AI crawlers and search engines using a community-maintained Prerender package.
TL;DR
Two community-maintained packages are available for integrating Prerender with Laravel: codebar-ag/Laravel-Prerender and JeroenNoten/laravel-prerender. Install your chosen package via Composer, register the middleware, add your Prerender token, and AI crawlers and search engines will receive fully rendered HTML instead of a JavaScript shell.
⚠️ Both packages are community-maintained and are not officially supported by Prerender. For issues with either package, refer to its GitHub repository.
Step 1: Create a Prerender account and copy your token
Go to prerender.io and create an account if you don't have one. Once logged in, open your Prerender dashboard and copy your Prerender token — you'll need it in Step 3.
ℹ️ Not sure which integration is right for your stack? Ask Nexus, your AI integration assistant, inside your Prerender dashboard — describe your setup and it will recommend the right path and walk you through configuration.
Step 2 — Choose a Laravel Prerender package
Two community packages are available. Check each repository's README for Laravel version compatibility before choosing:
| Package | Repository |
|---|---|
| codebar-ag/Laravel-Prerender | github.com/codebar-ag/Laravel-Prerender |
| JeroenNoten/laravel-prerender | github.com/JeroenNoten/laravel-prerender |
ℹ️ If you're unsure which to use, check the "Requirements" or "Installation" section of each README for the Laravel and PHP versions each package supports.
Step 3: Install and configure your chosen package
Follow the installation instructions in your chosen package's README to add it to your project via Composer and register the middleware in your Laravel application.
When you reach the configuration step, set your Prerender token — the one you copied in Step 1 — as the token value. This tells Prerender which account to associate cached renders with.
ℹ️ The middleware intercepts requests from AI crawlers and search engines and routes them to Prerender. Your website visitors bypass this flow entirely—their experience is unaffected.
Step 4: Deploy and verify your integration
Deploy your application. Then confirm Prerender is intercepting crawler requests correctly by running the following curl command, replacing the URL with one of your own pages:
curl -v -A googlebot https://www.yourpage.com/
Look for Prerender-specific response headers in the output. If they appear, your integration is active.
✅ Your integration is working when the curl response contains Prerender headers and returns fully rendered HTML—not a JavaScript shell. Cached pages should appear in your Prerender dashboard within 2–5 minutes of the first crawler request.
If you don't see Prerender headers, check your middleware configuration against the README and confirm your Prerender token is set correctly. For the "Prerender Integration Not Detected" error specifically, see What should I do if I receive a "Prerender Integration Not Detected" error?.
💬 Still need help?
If you have questions about configuring or troubleshooting your Laravel Prerender integration, our support team can help.
→ Contact us at support@prerender.io
Related articles
- Available integrations
- How do I integrate Prerender with my React, Angular, or Vue application?
- How do I integrate Prerender if I'm using a hosting platform that doesn't allow direct server access?
- Why am I seeing 403 or 404 errors after integrating Prerender?