markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.
1,019,029 17
Install
composer require markwalet/nova-modal-response
Latest Version:v1.2.1
PHP:^8.2
License:MIT
Last Updated:Jun 19, 2026
Links: GitHub  ·  Packagist
Maintainer: markwalet

Nova Modal Response

Build Status Total Downloads Latest Stable Version License

Enabling custom modals for action responses in Laravel Nova.

Example screenshot

More info for this specific feature can be found in the Nova Documentation.

Installation

composer require markwalet/nova-modal-response

This package requires PHP 8.2+ and Laravel 12+.

Usage

use Markwalet\NovaModalResponse\ModalResponse;

ModalResponse::text('This is way better than that small notification in the bottom right!')
    ->title('Result in a modal');

Note: Always build responses through the ModalResponse helper. Hand-rolling the raw payload with Action::modal('modal-response', [...]) is not a supported part of this package's API and may break without notice.

When you want to render raw html, you can use the html parameter instead:

ModalResponse::html('<ul><li>Show this package to your friends</li><li>Contribute</li><li>???</li><li>Profit!</li></ul>');

There is also a special mode for rendering code snippets. This will surround the body with a <pre> and <code> tag but still leave escaping enabled.

ModalResponse::code(file_get_contents(__FILE__))->title('Look at me!');

Syntax highlighting is enabled by default for code and json blocks. It is using highlight.js under the hood. You can disable this by calling ->withoutSyntaxHighlighting().

If you want to show some serializable data to the client, you can do that as well:

ModalResponse::json([
    'lorem' => 'ipsum',
    'dolor' => [
        'sit',
        'amet',
    ],
]);

You can also specify the size using the size option:

ModalResponse::text('Hello world')->size('7xl');

Related Packages

agelxnash/l4-confirm-action

Laravel 4 confirm user action

46 1
angel/modals

An Angel CMS module for modals.

95 0
tormjens/eventy

The WordPress filter/action system in Laravel

989,629 438
unm/laravel4-opencloud

A laravel 4.1 service provider package that wraps the Rackspace/Openstack PHP SD...

4 7
grohiro/laravel-action-submit

Laravel ActionSubmit button

42 3