Download the PHP package creagia/filament-code-field without Composer
On this page you can find all versions of the php package creagia/filament-code-field. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download creagia/filament-code-field
More information about creagia/filament-code-field
Files in creagia/filament-code-field
Package filament-code-field
Short Description A Filamentphp input field to edit or view code data.
License MIT
Homepage https://github.com/creagia/filament-code-field
Informations about the package filament-code-field
Filamentphp code field
A CodeMirror powered code field for the Filamentphp admin panel and form builder.
With code autocompletion, light/dark modes, multiple languages, read-only mode and more.
Check screenshots and read more about the package in our blog post.
Installation
Latest version of the package requires Filament 3 and Laravel 11.
You can install the package via composer:
⚠️ Use version 2.x.x
for Filament 3 and Laravel 10 support ⚠️
⚠️ Use version 1.x.x
for Filament 2 support ⚠️
Usage
Creating a code field is straightforward, just instantiate the CodeField
class for the desired property.
Choosing another language
By default, a JSON field will be created.
If you want to create a field for another supported language, you can do so with the setLanguage()
and helper methods.
Supported languages: JSON, PHP, HTML, XML and JavaScript (JS).
Disabling code completion
By default, the field comes with code completion/suggestions enabled.
For disabling this feature, use the disableAutocompletion()
.
Line numbers
Line numbers can be enabled using the withLineNumbers()
method.
Read-only mode
Adding the Filamentphp disabled()
method will make the code field read-only.
Filamentphp methods
Of course, the code field extends the Filamentphp
field class, and you can use all the usual methods such as label()
.
All versions of filament-code-field with dependencies
filament/filament Version ^3.2
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^9.0||^10.0||^11.0