Skip to content

Inertia Modal Integration

Inertia Table integrates directly with the free Inertia Modal package, so any row action or link can open its target page inside a modal or slideover instead of doing a full Inertia visit. Configure it inline with a simple array, or use the typed ModalVisit and ModalConfig builders for full control over the modal options.

Before continuing, install Inertia Modal by following its installation instructions.

Opening URLs in Modals

As shown in the Row Links documentation, you may call the modal() method on the Url class:

php
use InertiaUI\Table\Url;

Action::make('Edit', fn (User $user, Url $url) => $url
    ->route('users.edit', $user)
    ->modal()
);

You may tweak the modal options and configuration by either passing an array to the modal() method or by passing a ModalVisit or ModalConfig instance. The structure corresponds to the modalVisit() method of the Inertia Modal package. Here is an example of passing an array:

php
$url->route('users.edit', $user)->modal([
    'navigate' => true,
    'config' => ['slideover' => true],
]);

For typed objects, use the ModalVisit class from the Inertia Modal package:

php
use InertiaUI\Modal\ModalConfig;
use InertiaUI\Modal\ModalVisit;

$url->route('users.edit', $user)->modal(
    ModalVisit::make()
        ->navigate()
        ->config(ModalConfig::make()->slideover())
);

In most cases, only the ModalConfig class is needed, so you may use it directly:

php
use InertiaUI\Modal\ModalConfig;

$url->route('users.edit', $user)->modal(
    ModalConfig::make()->slideover()
);