{"id":23489952,"url":"https://github.com/stanleymasinde/laravel-prerender","last_synced_at":"2025-07-25T10:33:44.042Z","repository":{"id":37584557,"uuid":"242578375","full_name":"StanleyMasinde/laravel-prerender","owner":"StanleyMasinde","description":"Prerender middleware for laravel 6 and up","archived":false,"fork":false,"pushed_at":"2023-04-19T21:15:59.000Z","size":68,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-15T04:37:42.841Z","etag":null,"topics":["laravel","prerender"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StanleyMasinde.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-23T19:33:49.000Z","updated_at":"2022-04-25T00:18:21.000Z","dependencies_parsed_at":"2024-11-24T15:03:52.709Z","dependency_job_id":null,"html_url":"https://github.com/StanleyMasinde/laravel-prerender","commit_stats":{"total_commits":17,"total_committers":4,"mean_commits":4.25,"dds":0.5294117647058824,"last_synced_commit":"4a4bd09d58f5f7946a21575233c2c9913b1f4edd"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/StanleyMasinde/laravel-prerender","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StanleyMasinde%2Flaravel-prerender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StanleyMasinde%2Flaravel-prerender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StanleyMasinde%2Flaravel-prerender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StanleyMasinde%2Flaravel-prerender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StanleyMasinde","download_url":"https://codeload.github.com/StanleyMasinde/laravel-prerender/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StanleyMasinde%2Flaravel-prerender/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266991024,"owners_count":24017732,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","prerender"],"created_at":"2024-12-25T00:12:53.203Z","updated_at":"2025-07-25T10:33:43.954Z","avatar_url":"https://github.com/StanleyMasinde.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"#### For Laravel 5 and below, use the [Original Repo](https://github.com/JeroenNoten/Laravel-Prerender)\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/2d14c369b0844890afe990d50bd80975)](https://app.codacy.com/manual/stanleyloren/laravel-prerender?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=stannlee/laravel-prerender\u0026utm_campaign=Badge_Grade_Dashboard)\n\n=========================== \n\nGoogle, Facebook, Twitter, Yahoo, and Bing are constantly trying to view your website... but they don't execute javascript. That's why Prerender was built. Prerender is perfect for AngularJS SEO, BackboneJS SEO, EmberJS SEO, and any other javascript framework.\n\nThis middleware intercepts requests to your Laravel website or application from crawlers, and then makes a call to the (external) Prerender Service to get the static HTML instead of the javascript for that page.\n## Installation\n\nRequire this package run: `composer require stannlee/laravel-prerender`\n\nThe package registers it's service provider\n\nIf you want to make use of the prerender.io service, add the following to your `.env` file:\n\n    PRERENDER_TOKEN=yoursecrettoken\n\nIf you are using a self-hosted service, add the server address in the `.env` file.\n\n    PRERENDER_URL=http://example.com:port\n\nYou can disable the service by adding the following to your `.env` file:\n\n    PRERENDER_ENABLE=false\n\nThis may be useful for your local development environment.\n\n## How it works\n1. The middleware checks to make sure we should show a prerendered page\n\t1. The middleware checks if the request is from a crawler (`_escaped_fragment_` or agent string)\n\t2. The middleware checks to make sure we aren't requesting a resource (js, css, etc...)\n\t3. (optional) The middleware checks to make sure the url is in the whitelist\n\t4. (optional) The middleware checks to make sure the url isn't in the blacklist\n2. The middleware makes a `GET` request to the [prerender service](https://github.com/prerender/prerender) (phantomjs server) for the page's prerendered HTML\n3. Return that HTML to the crawler\n\n# Customization\n\nTo customize the whitelist and the blacklist, you first have to publish the configuration file:\n\n    $ php artisan vendor:publish\n\n### Whitelist\n\nWhitelist paths or patterns. You can use asterix syntax.\nIf a whitelist is supplied, only url's containing a whitelist path will be prerendered.\nAn empty array means that all URIs will pass this filter.\nNote that this is the full request URI, so including starting slash and query parameter string.\n\n```php\n// prerender.php:\n'whitelist' =\u003e [\n    '/frontend/*' // only prerender pages starting with '/frontend/'\n],\n```\n\n### Blacklist\n\nBlacklist paths to exclude. You can use asterix syntax.\nIf a blacklist is supplied, all url's will be prerendered except ones containing a blacklist path.\nBy default, a set of asset extentions are included (this is actually only necessary when you dynamically provide assets via routes).\nNote that this is the full request URI, so including starting slash and query parameter string.\n\n```php\n// prerender.php:\n'blacklist' =\u003e [\n    '/api/*' // do not prerender pages starting with '/api/'\n],\n```\n\n# Credits to the Orginal Creator [Jeroen Noten](https://github.com/JeroenNoten). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstanleymasinde%2Flaravel-prerender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstanleymasinde%2Flaravel-prerender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstanleymasinde%2Flaravel-prerender/lists"}