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

Umbrella Laravel Package

21torr/umbrella

View on GitHub
Deep Wiki
Context7

Getting Started

To leverage the static site export feature in this package, start by installing the package via Composer:

composer require vendor/package-name

Publish the package's configuration file to customize export settings:

php artisan vendor:publish --provider="Vendor\PackageName\PackageServiceProvider" --tag="config"

The simplest use case is exporting your Laravel application to static HTML files. Run the export command:

php artisan package-name:export

This will generate static files in storage/app/public/static-export by default. Review the config/package-name.php for customization options like output paths, excluded routes, and asset handling.

Implementation Patterns

Workflow Integration

  1. Development Workflow:

    • Use the export feature during development to preview static versions of your site. Test locally before deploying to production.
    • Integrate with your CI/CD pipeline to generate static exports as part of your build process.
  2. Deployment Workflow:

    • Export static files to a separate directory and deploy them to a static hosting service (e.g., Netlify, Vercel, or S3) for faster load times.
    • Use the --clean flag to clear the export directory before generating new files:
      php artisan package-name:export --clean
      
  3. Asset Handling:

    • Configure the assets option in the config file to specify how assets (CSS, JS, images) are handled. Options include:
      • copy: Copy assets as-is.
      • optimize: Optimize and minify assets during export.
      • skip: Exclude assets from the export.

Customization

Extend the export behavior by creating a custom command or service provider:

use Vendor\PackageName\Commands\ExportCommand;

class CustomExportCommand extends ExportCommand
{
    protected $signature = 'custom:export {--path= : Export path}';

    public function handle()
    {
        $this->configureExportPath($this->option('path'));
        parent::handle();
    }
}

Gotchas and Tips

Pitfalls

  • Dynamic Content: Ensure your application handles dynamic content gracefully. The static export will not work for routes that rely on server-side logic (e.g., sessions, user authentication).
  • Asset Paths: If your assets are referenced using absolute paths (e.g., /assets/style.css), update them to relative paths (e.g., assets/style.css) or configure the asset_url option in the config file.
  • Environment Variables: The export feature may not respect all environment variables. Test your application in a staging environment that closely mirrors production settings.

Debugging

  • Use the --verbose flag to get detailed logs during the export process:
    php artisan package-name:export --verbose
    
  • Check the storage/logs/laravel.log file for errors if the export fails silently.

Extension Points

  • Custom Exporters: Extend the Vendor\PackageName\Contracts\Exporter interface to create custom exporters for specific use cases.
  • Middleware: Add middleware to the export.middleware array in the config file to filter or modify requests during the export process.
  • Event Listeners: Listen to the package-name.exporting and package-name.exported events to hook into the export process and perform additional tasks. Example:
    public function handle(Exporting $event)
    {
        // Perform actions before export
    }
    
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.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
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