Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spatie/filament-markdown-editor
A markdown editor for Filament with code highlighting and image uploads
https://github.com/spatie/filament-markdown-editor
filament laravel markdown php
Last synced: 3 days ago
JSON representation
A markdown editor for Filament with code highlighting and image uploads
- Host: GitHub
- URL: https://github.com/spatie/filament-markdown-editor
- Owner: spatie
- License: mit
- Created: 2022-10-11T10:56:54.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-08T22:59:57.000Z (4 months ago)
- Last Synced: 2024-08-09T06:54:55.944Z (3 months ago)
- Topics: filament, laravel, markdown, php
- Language: JavaScript
- Homepage: https://spatie.be
- Size: 699 KB
- Stars: 129
- Watchers: 4
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# A markdown editor with code highlighting for Filament
[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/filament-markdown-editor.svg?style=flat-square)](https://packagist.org/packages/spatie/filament-markdown-editor)
[![run-tests](https://github.com/spatie/filament-markdown-editor/actions/workflows/run-tests.yml/badge.svg)](https://github.com/spatie/filament-markdown-editor/actions/workflows/run-tests.yml)
[![Total Downloads](https://img.shields.io/packagist/dt/spatie/filament-markdown-editor.svg?style=flat-square)](https://packagist.org/packages/spatie/filament-markdown-editor)This package contains a Markdown editor form field to be used in [Filament](https://filamentphp.com). The editor supports image uploads and will automatically highlight code snippets.
![screenshot](https://github.com/spatie/filament-markdown-editor/blob/main/docs/editor.jpg?raw=true)
The Markdown field is powered by [EasyMDE](https://github.com/Ionaru/easy-markdown-editor).
## Support us
[](https://spatie.be/github-ad-click/filament-markdown-editor)
We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).
## Installation
You can install the package via composer:
```bash
composer require spatie/filament-markdown-editor
```## Usage
In the `form` function of your Filament resource, you can use make use of the `Spatie\FilamentMarkdownEditor\MarkdownEditor` just like any other form element.
Optionally, you can tack on the standard Filament methods `fileAttachmentsDisk`, `fileAttachmentsVisibility`, ... to configure the image uploads.
```php
use Spatie\FilamentMarkdownEditor\MarkdownEditor;public static function form(Form $form): Form
{
return $form
->schema([
// other fields ...MarkdownEditor::make('text')
->fileAttachmentsDisk('admin-uploads')
->fileAttachmentsVisibility('public')
->required(),
]);
}
```## Testing
```bash
composer test
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Rias Van der Veken](https://github.com/riasvdv)
- [Dan Harrin](https://github.com/danharrin)
- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.