๐ฆ๐๐๐ฃ๐ฃ๐๐ก๐ ๐๐๐ฉ๐๐ช๐๐ฅ๐ ๐ฐ ๐๐ก๐ ๐๐๐จ๐ซ ๐๐ก ๐ ๐ฃ๐๐๐๐๐๐
Bundling an admin UI in a Laravel package is hard. Apps have built-in tools. Packages do not.
I hit four 500 errors while building laravel-config-webhook. Here are the lessons.
Component Naming Avoid double colons (::) in component names. Livewire 4 views these as namespaces. It will miss your component. Use dots instead.
- Wrong: config-webhook::webhooks
- Right: config-webhook.webhooks
Flux Icons Pro icons crash on free tiers. Use only free icons. I now use static tests to check icons against Flux files.
Vite Assets Avoid @vite in fallback layouts. Host apps lack compiled manifests. This causes a ViteManifestNotFoundException. Use a self-contained layout with a CDN.
Config Defaults Avoid placeholder strings in your config. Placeholders stop your fallback logic. Set defaults to null. This lets your fallback layout work.
Testing Build a workbench for your package. Test the full path. Seed data and verify routes. This prevents bugs.
Assume the host app provides nothing. Make your fallbacks self-sufficient.
Source: https://dev.to/nasrulhazim/shipping-a-livewire-4-flux-admin-ui-inside-a-package-four-gotchas-that-500d-on-me-1obp Optional learning community: github.com/cleaniquecoders/laravel-config-webhook