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 Package

spatie/laravel-export

Export a Laravel app as a static site bundle. Crawls your routes, renders HTML for each discovered URL, and copies the public directory so assets are included. Ideal for blogs and marketing sites hosted on Netlify or any static hosting.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Hybrid Static/Dynamic Architecture: Enable a build vs. buy decision for teams needing dynamic Laravel backends (e.g., admin panels like Nova/Filament) but static hosting for performance/scalability. Reduces reliance on server-side rendering for public-facing content.
  • Multi-Channel Publishing: Support roadmap items for:
    • Headless CMS integration (e.g., export blog posts to static sites for CDN delivery).
    • Multi-environment deployments (e.g., staging → static preview sites).
    • Offline-first workflows (e.g., export to S3 for global low-latency access).
  • Cost Optimization: Replace managed Laravel hosting (e.g., Forge/Heroku) with cheaper static hosting (Netlify/Vercel) while retaining dynamic features for authenticated routes.
  • SEO/Performance: Pre-render dynamic content (e.g., blog posts with comments) as static HTML to improve Core Web Vitals without sacrificing Laravel’s flexibility.
  • Disaster Recovery: Generate static backups of critical routes (e.g., /about, /pricing) to serve during outages.

When to Consider This Package

Adopt if:

  • Your Laravel app has public-facing routes that are read-heavy (e.g., blogs, marketing sites, documentation) but requires dynamic features (e.g., user auth, CMS editing) for other routes.
  • You need to decouple frontend hosting from backend infrastructure (e.g., move static assets to Netlify while keeping Laravel on a VPS).
  • Your team uses Laravel admin panels (Nova, Filament) but wants static hosting for scalability/cost savings.
  • You require offline exports (e.g., for internal wikis or client deliverables) without a live server.
  • You’re migrating from a traditional Laravel host to a JAMstack or static-first architecture.

Look elsewhere if:

  • Your app is fully dynamic (e.g., SaaS dashboards, real-time apps) with no static-friendly routes.
  • You need server-side rendering for all routes (e.g., user-specific content, WebSockets).
  • Your content is highly personalized (e.g., e-commerce product pages with user-specific pricing).
  • You’re already using a dedicated static site generator (e.g., Hugo, Next.js) and only need Laravel for APIs.
  • Your team lacks CI/CD pipelines to automate exports/deployments (hooks require shell access).

How to Pitch It (Stakeholders)

For Executives:

*"This package lets us combine the best of Laravel’s flexibility with the speed and cost-efficiency of static hosting. By exporting read-heavy routes (e.g., blogs, docs) to static HTML, we can:

  • Cut hosting costs by 60–80% (static sites on Netlify/Vercel are cheaper than Laravel servers).
  • Improve performance with instant load times and global CDN caching.
  • Simplify deployments—just upload static files instead of managing server configurations.
  • Future-proof our architecture for headless CMS or JAMstack migrations.

Example: Our blog currently costs $50/month on Forge. With this, we’d pay ~$10/month for static hosting while keeping Laravel for admin tools. No code changes required for static routes."*


For Engineering:

*"Laravel Export is a lightweight way to generate static HTML from your Laravel app’s routes, with these key benefits:

  • Zero-config crawling: Automatically exports all public routes (or specify paths manually).
  • Asset-aware: Includes the public folder (CSS/JS/images) by default.
  • Hooks for automation: Run yarn build, deploy to Netlify, or trigger notifications via before/after commands.
  • Streaming support: Reduces memory usage for large sites with --streaming.
  • Laravel 11+ compatible: Works with modern Laravel and PHP 8.2+.

Use cases:

  1. Static blogs/docs: Export /blog/* to Netlify while keeping /admin dynamic.
  2. Preview deployments: Generate static previews for PRs (e.g., php artisan export --paths=/pr/123).
  3. Offline exports: Create static backups of critical routes for disaster recovery.
  4. Hybrid auth: Serve static pages for guests, dynamic pages for logged-in users.

Trade-offs:

  • Not for SPAs: If your frontend is React/Vue, consider Next.js’s static exports instead.
  • Dynamic content limits: Static exports can’t handle user-specific data (e.g., /dashboard).

Proposal:

  • Start with a pilot (e.g., export /blog and host on Netlify).
  • Add CI hooks to auto-export on main branch pushes.
  • Measure cost savings and performance gains (e.g., Lighthouse scores).

Alternatives considered:

  • Manual static builds: More work; this package automates it.
  • Next.js: Overkill if we’re not rewriting the frontend.
  • Custom scripts: Less maintained than this battle-tested package."*
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.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata