Download the PHP package inventas/momentum-modal without Composer
On this page you can find all versions of the php package inventas/momentum-modal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download inventas/momentum-modal
More information about inventas/momentum-modal
Files in inventas/momentum-modal
Package momentum-modal
Short Description Build dynamic modal dialogs for your Inertia-powered Laravel apps
License MIT
Informations about the package momentum-modal
Momentum Modal
Momentum Modal is a headless Vue 3 modal system for Laravel applications that use Inertia 3. This Inventas fork contains the Laravel package and its matching Vue client.
The Vue client keeps the original modal, Modal, and useModal API. It uses the native Inertia 3 request interceptor. It does not change Axios defaults and does not require Axios.
Requirements
- PHP 8.2 or later
- Laravel 12 or 13
inertiajs/inertia-laravel3- Vue 3
@inertiajs/vue33
Installation
Add the Inventas repository and install the Laravel package.
Use the co-located Vue package. This keeps the existing momentum-modal imports in the application.
Run npm install after Composer installs the package. Do not install the old public momentum-modal package from the npm registry. That package uses the Inertia 1 and 2 Axios transport and does not support Inertia 3.
Client setup
Register the plugin with the same component resolver that Inertia uses.
Add the headless Modal host to a persistent layout.
The host owns the modal request interceptor, page watcher, and browser history listener. It removes these resources when the host unmounts. This makes the package safe for SSR and Vite hot module replacement.
TypeScript page props
The package exports its public types. Add modal to the application's existing Inertia shared page props declaration. If the application already defines sharedPageProps, add the field to that same type instead of adding a second declaration.
Do not add a local declaration for the momentum-modal module. The package includes its own declarations.
Server usage
Modal pages have normal routes. The base route supplies the background page when a modal URL is loaded directly.
Each modal response must call baseRoute() or baseURL(). The package reports a clear exception when the base URL is missing.
The legacy Inertia::dialog() and Inertia::render(...)->stackable() aliases remain available for applications that used the original package API.
Modal component API
Use useModal() in the resolved modal page component.
close() removes modal request context and starts the leave transition. redirect() removes the retained modal component and visits its return URL after that transition.
Development
Run the Laravel checks from the repository root.
Run all Vue client checks from vue/.
Credits
The package is based on the original work by Boris Lepikhin and the Momentum contributors. Inventas maintains this Inertia 3 fork.
License
Momentum Modal is open-source software licensed under the MIT license.
All versions of momentum-modal with dependencies
illuminate/support Version ^12.0|^13.0
inertiajs/inertia-laravel Version ^3.0