Download the PHP package timo-de-winter/filament-monaco-editor without Composer
On this page you can find all versions of the php package timo-de-winter/filament-monaco-editor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download timo-de-winter/filament-monaco-editor
More information about timo-de-winter/filament-monaco-editor
Files in timo-de-winter/filament-monaco-editor
Package filament-monaco-editor
Short Description A package to implement the monaco editor into a filament project
License MIT
Homepage https://github.com/timo-de-winter/filament-monaco-editor
Informations about the package filament-monaco-editor
Filament Monaco Editor
A package to implement the monaco editor into a filament project. Including a morphable model to relate code to any model. Obviously, you can use only the editor without publishing and running the migrations for the morphable model.
Installation
You can install the package via composer:
You can publish and run the migrations with:
You can publish the config file with:
This is the contents of the published config file:
Optionally, you can publish the views using
Usage
You can use the monaco editor directly in a form.
Code compilation
This package also comes with features to compile code. At this moment we support compilation of the following:
- SCSS -> CSS
Use as action
The package also comes with an action that you can add to your resources or pages.
In order to do this you should first add the following interface and trait to the model you want to use this on.
After doing that you can use both a table action and a default action.
By default, the code will be stored in the database under a specific collection. When not explicitly setting a collection we fall back to the language you use for the editor. However, you can explicitly set the collection as well (for example when you want to add the same language twice on the same model):
Using a grid within the actions
It is possible to use a (codepen like) grid in your actions by defining the collection as an array where key=collection and value=language.
If you want to set a default state for the different collections in the grid-style action you can do so like this:
Testing
Credits
- Timo de Winter
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of filament-monaco-editor with dependencies
filament/filament Version ^3.3
illuminate/contracts Version ^10.0||^11.0||^12.0
scssphp/scssphp Version ^2.0
spatie/laravel-package-tools Version ^1.16