{"id":25826536,"url":"https://github.com/webard/nova-suneditor","last_synced_at":"2025-02-28T15:35:13.679Z","repository":{"id":248521971,"uuid":"828953716","full_name":"webard/nova-suneditor","owner":"webard","description":"Custom field for Laravel Nova that integrates the SunEditor, a lightweight and flexible WYSIWYG editor.","archived":false,"fork":false,"pushed_at":"2024-11-18T07:43:56.000Z","size":2652,"stargazers_count":1,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-20T04:37:47.776Z","etag":null,"topics":["editor","laravel","laravel-nova","nova","nova-field","suneditor","wysiwyg"],"latest_commit_sha":null,"homepage":"","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/webard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2024-07-15T13:08:28.000Z","updated_at":"2024-11-26T17:07:39.000Z","dependencies_parsed_at":"2024-08-07T16:27:47.054Z","dependency_job_id":"08395952-a9ca-48e4-bd9c-bc85794a22ea","html_url":"https://github.com/webard/nova-suneditor","commit_stats":null,"previous_names":["webard/nova-suneditor"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webard%2Fnova-suneditor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webard%2Fnova-suneditor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webard%2Fnova-suneditor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webard%2Fnova-suneditor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webard","download_url":"https://codeload.github.com/webard/nova-suneditor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241175944,"owners_count":19922614,"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":["editor","laravel","laravel-nova","nova","nova-field","suneditor","wysiwyg"],"created_at":"2025-02-28T15:35:12.892Z","updated_at":"2025-02-28T15:35:13.671Z","avatar_url":"https://github.com/webard.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SunEditor Field for Laravel Nova\n\nThis package provides a custom field for Laravel Nova that integrates the SunEditor, a lightweight and flexible WYSIWYG editor.\n\n![screenshot](screenshot.png)\n\n## Features\n\n- Rich text editing capabilities with SunEditor.\n- Seamless integration with Laravel Nova.\n- Easy configuration and customization.\n- Emoji support within editor.\n\n## Installation\n\nTo install the custom field, follow these steps:\n\n1. Install the package via Composer:\n\n    ```sh\n    composer require webard/nova-suneditor\n    ```\n\n2. Publish the assets:\n\n    ```sh\n    php artisan vendor:publish --provider=\"Webard\\NovaSunEditor\\FieldServiceProvider\"\n    ```\n\n## Usage\n\nTo use the SunEditor field in your Laravel Nova resource, follow these steps:\n\n1. Import the field in your Nova resource file:\n\n    ```php\n    use Webard\\NovaSunEditor\\SunEditor;\n    ```\n\n2. Add the field to the `fields` method of your Nova resource:\n\n```php\npublic function fields(Request $request)\n{\n    return [\n        ID::make()-\u003esortable(),\n\n        SunEditor::make('Content', 'content')\n            -\u003erules('required', 'string')\n            -\u003ehideFromIndex(),\n    ];\n}\n```\n\n## File upload\n\nSunEditor supports uploading by drag\u0026drop or pasting image directly into editor field. To enable upload, provide `withFiles()` method, like in `Trix` field:\n\n```php\npublic function fields(Request $request)\n{\n    return [\n        ID::make()-\u003esortable(),\n\n        SunEditor::make('Content', 'content')\n            -\u003ewithFiles('disk','path/to/attachments')\n    ];\n}\n```\n\nUnfortunately, upload does not work out of the box with fields in Nova Actions (Trix has same problem). If you need to upload files in Action modal, provide path to upload in settings and handle upload by yourself:\n\n```php\npublic function fields(Request $request)\n{\n    return [\n        ID::make()-\u003esortable(),\n\n        SunEditor::make('Content', 'content')\n            -\u003ewithFiles('disk','path/to/attachments')\n            -\u003esettings([\n                'imageUploadUrl' =\u003e '/your/path/to/handle/upload',\n            ]),\n    ];\n}\n```\n\n## Customization\n\nThe SunEditor field can be customized by some methods:\n\n1. In `nova-suneditor.php` you can define more buttonLists and name them. Then, you can use buttonList using `buttonListName` method.\n\n```php\nSunEditor::make('Content', 'content')\n    -\u003ebuttonListName('my-buttons')\n```\n\n2. You can define buttonList directly in field definition:\n\n```php\nSunEditor::make('Content', 'content')\n    -\u003ebuttonList([\n        [\n            'undo',\n            'redo',\n            'bold'\n        ]\n    ]);\n```\n\n3. You can change settings directly in field definition:\n\n```php\nSunEditor::make('Content', 'content')\n    -\u003esettings([\n        'minHeight' =\u003e '500px'\n    ]);\n```\n\n## TODO\n\nI'm are actively seeking contributions to enhance this package. Here are some features I would love to see implemented:\n\n- [ ] multi-language\n- [ ] image browser\n- [ ] purging stale attachments like in `Trix` field\n\n## Contributing\n\nWe welcome contributions to improve this plugin! Please follow these steps to contribute:\n\n1. Fork the repository.\n2. Create a new branch for your feature or bug fix.\n3. Make your changes and commit them with descriptive messages.\n4. Push your changes to your forked repository.\n5. Open a pull request to the main repository.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE.md](LICENSE.md) file for more details.\n\n## Acknowledgements\n\n- [SunEditor](https://github.com/JiHong88/suneditor) - Excellent WYSIWYG editor.\n- [Picmo](https://github.com/joeattardi/picmo) - The emoji picker library used in this plugin.\n\n## Contact\n\nFor questions or support, please open an issue on GitHub.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebard%2Fnova-suneditor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebard%2Fnova-suneditor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebard%2Fnova-suneditor/lists"}