generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
372 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Changelog | ||
|
||
All notable changes to `filament-codemirror` will be documented in this file. | ||
All notable changes to `filament-json-field` will be documented in this file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,139 @@ | ||
# This is my package filament-codemirror | ||
<img src="https://banners.beyondco.de/Filament%20Json%20Field.png?theme=light&packageManager=composer+require&packageName=codebar-ag%2Ffilament-json-field&pattern=circuitBoard&style=style_2&description=A+Laravel+Filament Json Field+integration.&md=1&showWatermark=1&fontSize=150px&images=home&widths=500&heights=500"> | ||
|
||
[](https://packagist.org/packages/codebar-ag/filament-codemirror) | ||
[](https://github.com/codebar-ag/filament-codemirror/actions?query=workflow%3Arun-tests+branch%3Amain) | ||
[](https://github.com/codebar-ag/filament-codemirror/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain) | ||
[](https://packagist.org/packages/codebar-ag/filament-codemirror) | ||
[](https://packagist.org/packages/codebar-ag/filament-json-field) | ||
[](https://packagist.org/packages/codebar-ag/filament-json-field) | ||
[](https://github.com/codebar-ag/filament-json-field/actions/workflows/run-tests.yml) | ||
[](https://github.com/codebar-ag/filament-json-field/actions/workflows/phpstan.yml) | ||
|
||
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. | ||
This package was developed to give you a quick start to creating tickets via the Filament Json Field API. | ||
|
||
## Support us | ||
## 💡 What is Filament Json Field? | ||
|
||
[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/filament-codemirror.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/filament-codemirror) | ||
Filament Json Field is a Filament wrapper for Codemirror. | ||
|
||
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). | ||
## 🛠 Requirements | ||
|
||
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). | ||
| Package | PHP | Laravel | Filament Infolists | Filament Support | Filament Tables | | ||
|-----------|-------|------------|--------------------|------------------|-----------------| | ||
| v1.0 | 8.2 | 10.0, 11.0 | 3.2 | 3.2 | 3.2 | | ||
|
||
## Installation | ||
|
||
## ⚙️ Installation | ||
|
||
You can install the package via composer: | ||
|
||
```bash | ||
composer require codebar-ag/filament-codemirror | ||
|
||
composer require codebar-ag/filament-json-field | ||
php artisan filament:assets | ||
``` | ||
|
||
## To compile the assets for distribution | ||
|
||
## Usage | ||
|
||
Forms: | ||
```php | ||
use CodebarAg\FilamentJsonField\Forms\Components\JsonInput; | ||
|
||
... | ||
|
||
public function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
JsonInput::make('json') | ||
->label('JSON') | ||
->lineNumbers(true) | ||
->autoCloseBrackets(true) | ||
->darkTheme(true) | ||
->foldingCode(true), | ||
]); | ||
} | ||
... | ||
```` | ||
|
||
Infolists: | ||
```php | ||
use CodebarAg\FilamentJsonField\Forms\Components\JsonEntry; | ||
|
||
... | ||
|
||
public function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
JsonEntry::make('json') | ||
->label('JSON') | ||
->lineNumbers(true) | ||
->autoCloseBrackets(true) | ||
->darkTheme(true) | ||
->foldingCode(true), | ||
]); | ||
} | ||
... | ||
```` | ||
|
||
### Options | ||
|
||
The following options are currently supported: | ||
|
||
| Request | Supported | | ||
|---------------------|:-----------:| | ||
| Line Numbers | ✅ | | ||
| Auto Close Brackets | ✅ | | ||
| Dark Theme | ✅ | | ||
| Folding Code | ✅ | | ||
|
||
## 🚧 Testing | ||
|
||
Copy your own phpunit.xml-file. | ||
|
||
```bash | ||
node bin/build | ||
cp phpunit.xml.dist phpunit.xml | ||
``` | ||
|
||
## Testing | ||
Run the tests: | ||
|
||
```bash | ||
composer test | ||
./vendor/bin/pest | ||
``` | ||
|
||
## Changelog | ||
## 🚧 Building | ||
|
||
```bash | ||
node bin/build | ||
``` | ||
|
||
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. | ||
Note: there is no output, but the build will be in the `dist` directory. | ||
|
||
## Contributing | ||
## 📝 Changelog | ||
|
||
Please see [CONTRIBUTING](CONTRIBUTING.md) for details. | ||
Please see [CHANGELOG](CHANGELOG.md) for recent changes. | ||
|
||
## Security Vulnerabilities | ||
## ✏️ Contributing | ||
|
||
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details. | ||
|
||
```bash | ||
composer test | ||
``` | ||
|
||
### Code Style | ||
|
||
```bash | ||
./vendor/bin/pint | ||
``` | ||
|
||
Please review [our security policy](../../security/policy) on how to report security vulnerabilities. | ||
## 🧑💻 Security Vulnerabilities | ||
|
||
## Credits | ||
Please review [our security policy](.github/SECURITY.md) on reporting security vulnerabilities. | ||
|
||
- [Rhys Lees](https://github.com/43909932+RhysLees) | ||
## 🙏 Credits | ||
- [Rhys Lees](https://github.com/RhysLees) | ||
- [Sebastian Fix](https://github.com/StanBarrows) | ||
- [All Contributors](../../contributors) | ||
- [Skeleton Repository from Spatie](https://github.com/spatie/package-skeleton-laravel) | ||
- [Laravel Package Training from Spatie](https://spatie.be/videos/laravel-package-training) | ||
|
||
## License | ||
## 🎭 License | ||
|
||
The MIT License (MIT). Please see [License File](LICENSE.md) for more information. | ||
The MIT License (MIT). Please have a look at [License File](LICENSE.md) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace CodebarAg\FilamentJsonField\Concerns; | ||
|
||
use Closure; | ||
|
||
trait HasAutoCloseBrackets | ||
{ | ||
protected bool|Closure $hasAutoCloseBrackets = true; | ||
|
||
public function autoCloseBrackets(bool|Closure $condition = true): static | ||
{ | ||
$this->hasAutoCloseBrackets = $condition; | ||
|
||
return $this; | ||
} | ||
|
||
public function getHasAutoCloseBrackets(): bool | ||
{ | ||
return (bool) $this->evaluate($this->hasAutoCloseBrackets); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace CodebarAg\FilamentJsonField\Concerns; | ||
|
||
use Closure; | ||
|
||
trait HasDarkTheme | ||
{ | ||
protected bool|Closure $hasDarkTheme = false; | ||
|
||
public function darkTheme(bool|Closure $condition = true): static | ||
{ | ||
$this->hasDarkTheme = $condition; | ||
|
||
return $this; | ||
} | ||
|
||
public function getHasDarkTheme(): bool | ||
{ | ||
return (bool) $this->evaluate($this->hasDarkTheme); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace CodebarAg\FilamentJsonField\Concerns; | ||
|
||
use Closure; | ||
|
||
trait HasFoldingCode | ||
{ | ||
protected bool|Closure $hasFoldingCode = true; | ||
|
||
public function foldingCode(bool|Closure $condition = true): static | ||
{ | ||
$this->hasFoldingCode = $condition; | ||
|
||
return $this; | ||
} | ||
|
||
public function getHasFoldingCode(): bool | ||
{ | ||
return (bool) $this->evaluate($this->hasFoldingCode); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace CodebarAg\FilamentJsonField\Concerns; | ||
|
||
use Closure; | ||
|
||
trait HasLineNumbers | ||
{ | ||
protected bool|Closure $hasLineNumbers = true; | ||
|
||
public function lineNumbers(bool|Closure $condition = true): static | ||
{ | ||
$this->hasLineNumbers = $condition; | ||
|
||
return $this; | ||
} | ||
|
||
public function getHasLineNumbers(): bool | ||
{ | ||
return (bool) $this->evaluate($this->hasLineNumbers); | ||
} | ||
} |
Oops, something went wrong.