Download the PHP package emargareten/inertia-modal without Composer

On this page you can find all versions of the php package emargareten/inertia-modal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package inertia-modal

Inertia Modal

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps. With this package, you can define modal routes on the backend and dynamically render them when you visit a dialog route.

[!NOTE] This package supports Vue 3 only

Installation

You can install the package via composer:

Frontend Setup

[!WARNING] The package utilizes axios under the hood. If your app is already using axios as a dependency, make sure to lock it to the same version Inertia uses.

Modal Component

Modal is a headless component, meaning you have full control over its look, whether it's a modal dialog or a slide-over panel. You are free to use any 3rd-party solutions to power your modals, such as Headless UI.

Put the Modal component somewhere within the layout.

[!NOTE] Ensure that the layout remains persistent throughout the entire application. If you have multiple layouts, create a base layout that should invoke the modal, using nested layouts.

Plugin

Set up a modal plugin with the same component resolver you use to render Inertia pages.

Vite

Laravel Mix

Usage

Modals have their own routes, letting you access them even via direct URLs. Define routes for your modal pages.

Render a modal from a controller. Specify the base route to render the background when the modal is accessed directly.

By default, the backdrop component will be preserved with its current [stale] data (besides for the validation errors), in most cases this is fine since it will refresh when we close the modal (redirect to the base route), if your app does need fresh data for the backdrop, add the refreshBackdrop method:

To force a specific route as the backdrop add the forceBase method:

This will force re-render of the base route (or even redirect to a different base route).

Both of the above methods can also accept a boolean whether to refresh etc.

Frontend implementation

Use the useModal() composable in your modal component.

This example is a simple headlessui modal, you can add more transitions etc. see https://headlessui.com/vue/dialog.

The redirect method will redirect to the base route, you can pass in all inertia visit options as a parameter.

The close method will close the modal without redirecting to the base route.

[!NOTE] For a more concise setup, consider configuring aliases instead of specifying the full path.

Using vite:

Using mix:

Now you can import the modules like this:

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

This package was highly inspired by momentum-modal

License

The MIT License (MIT). Please see License File for more information.


All versions of inertia-modal with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^8.24|^9.0|^10.0|^11.0
inertiajs/inertia-laravel Version ^0.6.9|^1.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package emargareten/inertia-modal contains the following files

Loading the files please wait ....