webniucom/webniu
Webniu is a Laravel/PHP package that bundles handy utilities for building and maintaining web applications, aiming to simplify common setup and integration tasks so developers can ship features faster with less boilerplate. Suitable for small projects and larger apps alike.
v1.3.0 moves the package to a base + sub-application micro-frontend architecture. The most important consequence for a Laravel developer is that the main framework is compiled once, and each functional module (sub-app) is now built, packaged, installed and uninstalled independently. That changes both your local workflow and your deployment pipeline, so read this before touching code.
Minimal path to a working install:
composer require the package into a fresh Laravel app (Laravel 9/10/11 depending on your constraint), then run the installer/publish command to emit config, migrations and the base frontend scaffold.npm install && npm run build in the base app). You should not need to rebuild it again when adding or removing modules — that is the headline feature of 1.3.0.Where to look first:
config/<package>.php or equivalent) for the module/sub-app registry, install paths and asset disk.composer.json, frontend package.json, routes, migrations, service provider and a manifest describing its menu/permissions.First use case: scaffold one thin sub-app (a single CRUD screen), install it, and uninstall it. Doing this once end-to-end teaches you the lifecycle before you inherit someone else's module.
Treat a sub-app as a deployable unit, not a folder. Each sub-app should own its routes, migrations, permissions, menu entries and frontend bundle. Registration belongs in the sub-app's service provider, loaded through the base registry — avoid adding require lines to the base app's providers by hand, since that defeats the install/uninstall model and will drift.
Install/uninstall lifecycle. Wire install and uninstall into artisan commands or the package's own install mechanism, and make them idempotent:
--purge flag — silent data loss on uninstall is the most common complaint with this style of architecture.Independent frontend development. Use the sub-app's own dev server with a proxy/HMR configuration pointed at the base host. Keep shared dependencies (Vue/React, UI library, state manager) declared as externals or in a shared import map so the sub-app does not ship a second copy of the framework. A duplicated runtime is the fastest way to get "two instances of the store" bugs.
Contract versioning. The base shell exposes a contract (mount function signature, event bus, shared services, route helpers). Pin the sub-app against a base contract version and record it in the sub-app manifest. On v1.3.0, base and sub-apps are now separately versioned, so this pin is your only protection against a sub-app built for an older shell.
Integration points in Laravel. Menu/route/permission registration should flow through the registry so a sub-app can be added without editing base files. For anything shared — auth context, current user, permission checks — expose it from the base shell rather than re-fetching inside the sub-app; duplicated auth calls are a recurring source of flickering UIs and 401s on cold load.
Deployment. Build sub-apps in their own CI jobs and publish artifacts to wherever the base shell fetches them from. Because the base no longer recompiles, deployment becomes: upload sub-app bundle → run install/migration step → flush caches. Keep the previous sub-app bundle addressable so a rollback is an asset swap, not a full redeploy.
Upgrading the base. With decoupled builds you can upgrade the base shell without rebuilding every sub-app — but only if the contract is stable. Test the oldest sub-app you still support against the new base before rolling out.
manifest.json being served.updateOrCreate/firstOrCreate in seeders and guard migrations.subapp.resource.action) in your module scaffolding.How can I help you explore Laravel packages today?