spatie/laravel-export
Export a Laravel app as a static site bundle. Crawls your routes to generate HTML for every URL and copies your public assets into an export folder, ready to upload to Netlify or any static host—keep Laravel tools locally while deploying static.
public directory (CSS, JS, images), ensuring assets are bundled without manual intervention.php artisan export) or CI/CD triggers.Route::get()) may miss or incorrectly crawl routes with complex constraints (e.g., API routes, locale prefixes).
export:ignore to exclude non-static routes.mix-manifest.json or Vite’s asset manifest to ensure correct paths.php artisan export vs. automated CI/CD?)php artisan export:test (if available) or manually inspect generated files.php artisan vendor:publish --provider="Spatie\Export\ExportServiceProvider").export:ignore rules for non-static routes (e.g., /admin, API endpoints).npm run build or vite build)./public/ prefix leaks).[USER_NAME]).main):
# Example GitHub Actions step
- name: Export static site
run: php artisan export
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.2
with:
publish-dir: './export'
composer.json for exact range).Route::get('blog/{post}', ...) is crawlable.auth, guest, or locale middleware.api/ and ignore in config.spatie/laravel-seo) render correctly.netlify.toml):
[build]
publish = "export"
command = "php artisan export"
spatie/laravel-export for breaking changes (MIT license allows forks if needed).composer update spatie/laravel-export.config/export.php backup for rollbacks.public/ directory is excluded from version control (if using Git) or managed via deployment.url() helper uses absolute paths in Blade.public/ directory is copied to export/ during build.php artisan export:test or inspect the crawler’s route list.How can I help you explore Laravel packages today?