Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Export

Laravel Export Laravel Package

spatie/laravel-export

Turn a Laravel app into a static site bundle. Laravel Export crawls every URL, renders HTML pages, copies your public assets, and saves a ready-to-host export with one artisan command—ideal for blogs and admin-managed sites published to static hosting.

View on GitHub
Deep Wiki
Context7

spatie/laravel-export turns your Laravel application into a fully static site bundle. Running php artisan export crawls every URL in your app, renders each one to HTML, and copies the entire public directory so your assets ship alongside the pages. It's ideal for building blogs or documentation, or for publishing content managed in Nova, Filament, or Wink to a static host like Netlify—keeping a dynamic admin backend while serving fast, static pages.

  • Crawls and renders every discoverable URL to HTML
  • Copies the complete public directory into the bundle
  • Writes output to a configurable filesystem disk
  • Optional config publishing for fine-tuning behavior
  • Works with any admin panel or content source
Frequently asked questions about Laravel Export
What is spatie/laravel-export used for?
spatie/laravel-export creates a static site bundle from a Laravel application by crawling URLs, rendering each page through Laravel, copying public assets, and writing everything to a configured disk with php artisan export. It is commonly used for blogs, documentation sites, and hybrid setups where a dynamic Laravel admin panel manages content while the public site is hosted statically.
How do I install spatie/laravel-export in a Laravel app?
Install it with composer require spatie/laravel-export, optionally publish the config file with php artisan vendor:publish, and run php artisan export. There are no migrations, schema changes, or API contracts to add, so integration is mostly Composer plus configuration.
Which Laravel versions does spatie/laravel-export support?
The package tracks first-party Laravel releases, and the supplied evaluation notes indicate support through Laravel 11, 12, and 13. Always check the README and Composer constraints before upgrading, especially when moving major Laravel versions.
How does Laravel Export decide which URLs to crawl?
By default the package crawls and follows URLs it discovers, which is convenient but can also find admin routes, filters, paginated archives, and other unintended pages. You can configure explicit paths, turn crawling on or off, and use include or exclude patterns to constrain the export. You can also drive paths through the injected Exporter class, for example from database records, instead of maintaining a hand-written list.
Can I use spatie/laravel-export with Filament, Nova, Wink, or Sharp?
Yes. A common pattern is to keep Filament, Nova, Wink, Sharp, or another admin panel as the authoring surface and export the public-facing pages as static files. This gives you static hosting benefits for the public site while retaining a dynamic Laravel backend for content management. Make sure admin and private routes are excluded from the export.
How do I prevent admin or private routes from being exported?
Do not rely on crawler discovery alone on a mature application. Define explicit paths or use exclusion patterns and an allow or deny boundary before the first production run. You can set this in the config or programmatically through the Exporter class so private, authenticated, and administrative URLs never enter the bundle.
What happens to forms, search, and authentication on an exported static site?
Static hosting cannot process POST requests or writes, so contact forms, search, authentication, and similar dynamic flows will not work unless they are re-pointed at an external API or service. Scope these features before committing to a static export. Any endpoint that requires a server-side write must be handled outside the static bundle or removed from the public site.
How can I make Laravel Export builds faster for large sites?
Crawling is time-bound and build time generally scales with the number of pages, so keep the exported URL set as small and explicit as possible. The use_streaming option, added in 1.4.0, reduces memory usage but does not eliminate wall-clock build time. Move heavy asset builds and deployment steps into CI rather than relying on package hooks.
Can I run build or deployment commands with Laravel Export hooks?
The package supports before and after shell hooks, but hardcoded absolute binaries such as /usr/local/bin/yarn can be fragile across local machines, CI, and container images. Prefer running build and deploy steps in your CI pipeline and leaving the hooks empty unless you have a controlled environment.
Is spatie/laravel-export maintained and safe for production use?
The package is MIT licensed, has a README, changelog, releases, active patch cadence, and Spatie stewardship, which are credible maturity signals. The main maintenance risk is vendor churn around its transitive spatie/crawler dependency, since a major crawler upgrade could introduce breaking changes. Test upgrades in CI before relying on a new release in production.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
alphabalex/messaging-made-easy
rawphp/warp
shootkiran/merobug
narakode/fineauth
numencode/wn-syncops-plugin
ibnnajjaar/mib-global-pay
ably/pubsub-server
mstfkhazaal/defender
mfonte/base62x
karnoweb/metapilot
tobya/bcsapiwrapper
swalker2/cpanel
vish4395/laravel-translation-manager
morningtrain/economic
teksite/systeminfo-laravel
atomcms/voting
run6/weather
siokas/laravelembeddirectives
adamlien/pkuuids
gilsonsouza/lara-doc-generator