{"id":13733503,"url":"https://github.com/creagia/filament-code-field","last_synced_at":"2026-04-21T04:06:03.100Z","repository":{"id":63903700,"uuid":"566411734","full_name":"creagia/filament-code-field","owner":"creagia","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-20T15:02:33.000Z","size":1466,"stargazers_count":58,"open_issues_count":1,"forks_count":14,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-04-20T17:10:34.681Z","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/creagia.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"creagia"}},"created_at":"2022-11-15T16:07:57.000Z","updated_at":"2026-04-20T15:02:29.000Z","dependencies_parsed_at":"2024-04-29T15:01:27.339Z","dependency_job_id":"71fd4d7e-0fa0-4a71-90b8-f8e70ad3aca8","html_url":"https://github.com/creagia/filament-code-field","commit_stats":{"total_commits":21,"total_committers":5,"mean_commits":4.2,"dds":"0.33333333333333337","last_synced_commit":"d4fad592725108ee55efef3672f86fc37b2e0e46"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/creagia/filament-code-field","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creagia%2Ffilament-code-field","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creagia%2Ffilament-code-field/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creagia%2Ffilament-code-field/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creagia%2Ffilament-code-field/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creagia","download_url":"https://codeload.github.com/creagia/filament-code-field/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creagia%2Ffilament-code-field/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32076295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T02:38:07.213Z","status":"ssl_error","status_checked_at":"2026-04-21T02:38:06.559Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-08-03T03:00:44.320Z","updated_at":"2026-04-21T04:06:03.063Z","avatar_url":"https://github.com/creagia.png","language":"PHP","funding_links":["https://github.com/sponsors/creagia"],"categories":["Fields"],"sub_categories":[],"readme":"# Filamentphp code field\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/creagia/filament-code-field.svg?style=flat-square)](https://packagist.org/packages/creagia/filament-code-field)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/creagia/filament-code-field/run-tests.yml?label=tests)](https://github.com/creagia/filament-code-field/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/creagia/filament-code-field/fix-php-code-style-issues.yml?label=code%20style)](https://github.com/creagia/filament-code-field/actions?query=workflow%3A\"Check+%26+fix+styling\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/creagia/filament-code-field.svg?style=flat-square)](https://packagist.org/packages/creagia/filament-code-field)\n\nA [CodeMirror](https://codemirror.net/) powered code field for the Filamentphp admin panel and form builder.\n\nWith code autocompletion, light/dark modes, multiple languages, read-only mode and more.\n\nCheck screenshots and read more about the package in our [blog post](https://creagia.com/blog/a-code-field-for-the-filamentphp-admin-panel-and-form-builder).\n\n## Installation\n\n**Latest version of the package requires Filament 3 and Laravel 11.**\n\nYou can install the package via composer:\n\n```bash\ncomposer require creagia/filament-code-field\n```\n\n### ⚠️ Use version `2.x.x` for Filament 3 and Laravel 10-12 support ⚠️\n```bash\ncomposer require \"creagia/filament-code-field:^2.0.0\"\n```\n\n### ⚠️ Use version `1.x.x` for Filament 2 support ⚠️\n```bash\ncomposer require \"creagia/filament-code-field:^1.0.0\"\n```\n\n\n## Usage\n\nCreating a code field is straightforward, just instantiate the `CodeField` class for the desired property.\n\n```php\nuse Creagia\\FilamentCodeField\\CodeField;\n\nreturn $form\n    -\u003eschema([\n        CodeField::make('my_json'),\n        // other fields\n    ]);\n```\n\n### Choosing another language\n\nBy default, a JSON field will be created. \n\nIf you want to create a field for another supported language, you can do so with the `setLanguage()` and helper methods.\n\nSupported languages: JSON, PHP, HTML, XML and JavaScript (JS).\n\n```php\nuse Creagia\\FilamentCodeField\\CodeField;\n\nreturn $form\n    -\u003eschema([\n        CodeField::make('js_code')\n            -\u003esetLanguage(CodeField::JS),\n            // or\n            -\u003ejsField()\n    ]);\n```\n\n### Disabling code completion\n\nBy default, the field comes with code completion/suggestions enabled.\n\nFor disabling this feature, use the `disableAutocompletion()`.\n\n```php\nuse Creagia\\FilamentCodeField\\CodeField;\n\nreturn $form\n    -\u003eschema([\n        CodeField::make('js_code')\n            -\u003ehtmlField()\n            -\u003edisableAutocompletion(),\n    ]);\n```\n\n### Line numbers\n\nLine numbers can be enabled using the `withLineNumbers()` method.\n\n```php\nuse Creagia\\FilamentCodeField\\CodeField;\n\nreturn $form\n    -\u003eschema([\n        CodeField::make('json')\n            -\u003ewithLineNumbers(),\n    ]);\n```\n\n### Read-only mode\n\nAdding the Filamentphp `disabled()` method will make the code field read-only.\n\n```php\nuse Creagia\\FilamentCodeField\\CodeField;\n\nreturn $form\n    -\u003eschema([\n        CodeField::make('json')\n            -\u003edisabled(),\n    ]);\n```\n\n### Filamentphp methods\n\nOf course, the code field extends the `Filamentphp` field class, and you can use all the usual methods such as `label()`.\n\n```php\nuse Creagia\\FilamentCodeField\\CodeField;\n\nreturn $form\n    -\u003eschema([\n        CodeField::make('json')\n            -\u003elabel('Your JSON data')\n            -\u003ehint('Top right corner info')\n            -\u003ehelper('More info after the text field')\n            // more methods\n            ,\n    ]);\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreagia%2Ffilament-code-field","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreagia%2Ffilament-code-field","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreagia%2Ffilament-code-field/lists"}