markwalet / nova-modal-response
A Laravel Nova asset for Modal responses on an action.
Requires
- php: ^8.2
- laravel/framework: ^12.0|^13.0
- laravel/nova: ^5.0
Requires (Dev)
- larastan/larastan: ^3.9
- laravel/nova-devtool: ^1.1
- laravel/pint: ^1.29
- orchestra/testbench: ^10.8|^11.0
- phpunit/phpunit: ^11.5
- dev-main
- v2.x-dev
- v1.2.0
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.3.1
- v0.3.0
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
- dev-v2-77-wire-copy-button
- dev-v2-embedded-icons
- dev-serve-watch-assets
- dev-copy-button-code-json
- dev-v2-block-factory-split
- dev-syntax-highlighting-argument
- dev-v2-block-factory-refactor
- dev-v2-61-inline-alignment
- dev-v2-58-markdown-block
- dev-v2-60-collapsible-block
- dev-v2-59-view-block
- dev-v2-56-coerce-strings-to-text
- dev-v2-49-icon-inline-atom
- dev-v2-48-link-inline-atom
- dev-v2-47-inline-group-block
- dev-v2-42-legacy-warn
- dev-41-remove-raw-action-modal-docs
- dev-43-boost-guideline
- dev-v2-30-bulk-highlight
- dev-v2-24-json-block
- dev-v2-23-code-block
- dev-v2-27-badge-block
- dev-v2-29-list-block
- dev-v2-26-heading-block
- dev-v2-25-html-block
- dev-v2-28-divider-block
- dev-refresh-cards-example
This package is auto-updated.
Last update: 2026-05-27 15:42:48 UTC
README
Enabling custom modals for action responses in Laravel Nova.
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
ModalResponsehelper. Hand-rolling the raw payload withAction::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');
