{"id":15873813,"url":"https://github.com/markwalet/nova-modal-response","last_synced_at":"2025-03-16T04:30:45.701Z","repository":{"id":65531366,"uuid":"594104525","full_name":"markwalet/nova-modal-response","owner":"markwalet","description":"A Laravel Nova asset for Modal responses on an action.","archived":false,"fork":false,"pushed_at":"2025-02-03T10:46:06.000Z","size":894,"stargazers_count":14,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T10:03:17.904Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markwalet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"markwalet","custom":["https://www.paypal.me/markwalet"]}},"created_at":"2023-01-27T15:59:36.000Z","updated_at":"2025-02-27T12:10:56.000Z","dependencies_parsed_at":"2025-02-03T11:27:29.193Z","dependency_job_id":"b81b6469-5f07-4210-990f-355480531077","html_url":"https://github.com/markwalet/nova-modal-response","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"51540bd994d12bd6dbb334b6db62617797ce07ee"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwalet%2Fnova-modal-response","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwalet%2Fnova-modal-response/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwalet%2Fnova-modal-response/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwalet%2Fnova-modal-response/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markwalet","download_url":"https://codeload.github.com/markwalet/nova-modal-response/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243802943,"owners_count":20350316,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-06T01:06:59.466Z","updated_at":"2025-03-16T04:30:45.689Z","avatar_url":"https://github.com/markwalet.png","language":"PHP","funding_links":["https://github.com/sponsors/markwalet","https://www.paypal.me/markwalet"],"categories":[],"sub_categories":[],"readme":"# Nova Modal Response\n\n[![MIT Licensed](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![Latest Stable Version](https://poser.pugx.org/markwalet/nova-modal-response/v/stable)](https://packagist.org/packages/markwalet/nova-modal-response)\n[![Total Downloads](https://poser.pugx.org/markwalet/nova-modal-response/downloads)](https://packagist.org/packages/markwalet/nova-modal-response)\n\n\nEnabling custom modals for action responses in [Laravel Nova](https://nova.laravel.com).\n\n![Example screenshot](readme-heading.png)\n\nMore info for this specific feature can be found in the [Nova Documentation](https://nova.laravel.com/docs/4.0/actions/defining-actions.html#custom-modal-responses).\n\n## Installation\n\n```shell\ncomposer require markwalet/nova-modal-response\n```\n\n## Usage\n\n```php\nuse Markwalet\\NovaModalResponse\\ModalResponse;\n\nModalResponse::text('This is way better than that small notification in the bottom right!')\n    -\u003etitle('Result in a modal');\n\n// Modals can also be manually created in Nova\nuse Laravel\\Nova\\Actions\\Action;\n\nreturn Action::modal('modal-response', [\n    'title' =\u003e 'Result in a model',\n    'body' =\u003e 'This is way better than that small notification in the bottom right!',\n]);\n```\n\nWhen you want to render raw html, you can use the `html` parameter instead:\n\n```php\nModalResponse::html('\u003cul\u003e\u003cli\u003eShow this package to your friends\u003c/li\u003e\u003cli\u003eContribute\u003c/li\u003e\u003cli\u003e???\u003c/li\u003e\u003cli\u003eProfit!\u003c/li\u003e\u003c/ul\u003e');\n```\n\nThere is also a special mode for rendering code snippets. This will surround the body with a `\u003cpre\u003e` and `\u003ccode\u003e` tag but still leave escaping enabled. \n\n\n```php\nModalResponse::code(file_get_contents(__FILE__))-\u003etitle('Look at me!');\n```\nSyntax highlighting is enabled by default for code and json blocks. It is using [highlight.js](https://highlightjs.org/) under the hood. You can disable this by calling `-\u003ewithoutSyntaxHighlighting()`.\n\nIf you want to show some serializable data to the client, you can do that as well:\n\n```php\nModalResponse::json([\n    'lorem' =\u003e 'ipsum',\n    'dolor' =\u003e [\n        'sit',\n        'amet',\n    ],\n]);\n```\n\nYou can also specify the size using the `size` option:\n```php\nModalResponse::text('Hello world')-\u003esize('7xl');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkwalet%2Fnova-modal-response","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkwalet%2Fnova-modal-response","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkwalet%2Fnova-modal-response/lists"}