- 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.