Weave Code
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

Export your Laravel app as a static site bundle. Crawls your routes to generate HTML for discovered URLs and includes the public directory for assets. Ideal for blogs/sites built with Laravel, then deployed to Netlify or any static host.

View on GitHub
Deep Wiki
Context7

Create a static site bundle from a Laravel app

Frequently asked questions about Laravel Export
Can I use Laravel Export to convert my Nova/Filament admin panel into a static site?
No, this package is designed for static *content* like blogs or marketing pages, not interactive admin panels. Dynamic features (e.g., real-time updates, user sessions) won’t work post-export. Use it for public-facing routes only.
How do I exclude certain routes or files from the export?
Use the `exclude_route_patterns` and `exclude_file_patterns` config options to skip specific routes or files. For example, exclude `/admin/**` routes or `*.map` files. These are set in the published config file.
Will my Laravel Mix/Vite assets (CSS/JS) be included in the static export?
Yes, the package copies the entire `public/` directory by default, including compiled assets. If you use custom paths, specify them in `include_files` or `exclude_file_patterns` in the config.
Does Laravel Export support Laravel 10 or 11? What’s the latest version compatibility?
The package officially supports Laravel 7–13 (as of v2.x). For Laravel 10/11, ensure you’re using the latest release (check Packagist). No breaking changes exist for modern Laravel features like Livewire or Inertia.
How can I pre-render dynamic data (e.g., user-specific content) for static exports?
Use the `before` and `after` hooks in the config to pre-fetch data or modify Blade templates. For example, cache `Auth::user()` in a middleware or hook to render it statically. Dynamic auth checks won’t persist post-export.
Is there a way to test the export without generating all files (e.g., for CI/CD)?
Yes, use the `--skip-all` flag with the `export` command to simulate crawling without writing files. Alternatively, enable `use_streaming: true` in the config to handle large sites incrementally.
Can I deploy the exported static files directly to S3 or another cloud storage?
Yes, configure the `export` disk in `config/filesystems.php` to point to your S3 bucket or remote storage. The package uses Laravel’s filesystem, so any supported disk driver (e.g., `s3`, `ftp`) will work.
What happens if my site has JavaScript-rendered content (e.g., SPAs or dynamic routes)?
The crawler may miss content rendered via JS. For critical pages, manually specify routes using `paths()` in the config or integrate a headless browser (e.g., Puppeteer) via a custom crawler.
How do I handle middleware like auth during static export? Static pages won’t respect auth checks.
Static exports ignore middleware like `auth`. To pre-render content, mock auth data in hooks (e.g., set a default user in `before` commands) or use middleware to pre-fetch data (e.g., cache user roles in Blade).
Are there alternatives to Laravel Export for static site generation in Laravel?
Yes, consider `spatie/laravel-static-page-generator` (simpler, route-focused) or `spatie/laravel-sitemap` for SEO. For full SSG, explore `laravel-vapor` (Vapor-specific) or `jekyll` (Ruby-based) if you need broader templating. Laravel Export is unique for its Laravel-native integration.
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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai