Download the PHP package tofandel/inertia-vue-modal without Composer

On this page you can find all versions of the php package tofandel/inertia-vue-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-vue-modal

Inertia Vue Modal

Warning

I stopped development of this package and will not be using it anymore, there is a lot of issues with it and it is definitely not something I'd recommend using in production. Have a look at momentum-modal for an alternative or hybridly for complete inertia alternative (and much more)

Warning

Limitations

This POC is a very early draft, so these limitations will probably be fixed soon.

Installation

Client-side installation

In your layout, you need to add the InertiaModal component, here is an example using the Quasar Dialog

Axios dependency

It's very important that your project only uses one version of axios because of the use of interceptors, if you use webpack and your packages have conflicting versions of axios they will each be bundled separately and interceptors won't work To resolve this issue make sure that you add this to your webpack.config.js

Server-side installation

In your Laravel application, you need to extend our HandlesInertiaModalRequest middleware

Usage

Since we added the InertiaModal component, the global $inertia object now has a visitInModal method. This allows you to make an Inertia visit that loads into the modal.

You can use this method, for example, in the @click handler of a button:

Instead of using the method in your template, you can also use it in your script:

Update the page you want to load into a modal

In most cases, the /user/create endpoint renders a form that's wrapped into a template, maybe with other components and components to style the form. Here's a simple example of what the UserCreate.vue component might look like:

To load this form into a modal, we don't want the sidebar, footer, and styling from the form-panel component. We want just the form itself!

To accomplish this, you need to do three things:

  1. Add the IsModalable mixin to your component.
  2. Wrap your whole component into the Modalable component.
  3. Move the form to a separate #toModal template and replace it with a ToModal component.

Now when you visit /user/create, nothing has changed! You still have your layout and form-panel styling. But when you load this component into a modal, it will only render the form.

Handling redirects

By default, redirects are handled as any other Inertia request. For example you're visiting /user, you open /user/create in a modal, and after a successful submit, you redirect the user to the detail page of the newly created user:

You might not always want to route to the detail page. Luckily, you don't have to update your server-side implementation.

The visitInModal method accepts a second argument that can either a Boolean or a callback. Instead of redirecting the user, the user stays on the same page, and you can manually handle the event with the callback. This callback is executed after a successful request, for example, when the new user is stored in the database.


All versions of inertia-vue-modal with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
inertiajs/inertia-laravel Version >=0.5
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 tofandel/inertia-vue-modal contains the following files

Loading the files please wait ....