From 0eb046c3aa27084b9a4ebbc24b1a5048e907dc52 Mon Sep 17 00:00:00 2001 From: alexvenga Date: Thu, 6 Jul 2023 21:44:57 +0300 Subject: [PATCH] Pre-release --- README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7531c16..3c0b829 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,50 @@ -# Spatie\MediaLibrary field for [MoonShine Laravel admin panel](https://moonshine.cutcode.dev) +# Laravel translations manager for [MoonShine admin panel](https://moonshine.cutcode.dev) [![Latest Version on Packagist](https://img.shields.io/packagist/v/visual-ideas/moonshine-laravel-translations.svg?style=flat-square)](https://packagist.org/packages/visual-ideas/laravel-site-settings) [![Total Downloads](https://img.shields.io/packagist/dt/visual-ideas/moonshine-laravel-translations.svg?style=flat-square)](https://packagist.org/packages/visual-ideas/laravel-site-settings) -## Documentation +## Installation + +You can install the package via composer: + +```bash +composer require visual-ideas/moonshine-laravel-translations +``` + +You must run the migrations with: + +```bash +php artisan migrate +``` + +You can publish the config file with: + +```bash +php artisan vendor:publish --provider="VI\MoonShineLaravelTranslations\Providers\MoonShineLaravelTranslationsServiceProvider" --tag="config" +``` + + +This is the contents of the published config file: + +```php +TODO Config info +``` + +Add new MoonShine resource to your MoonShineServiceProvider file, like this: + +```php +MenuItem::make('Переводы', new \VI\MoonShineLaravelTranslations\Resources\MoonShineLaravelTranslationResource()) + ->translatable() + ->badge(fn()=>cache()->remember('moonshine_laravel_translations_changed_count', + now()->addMinute(), + fn()=>\VI\MoonShineLaravelTranslations\Models\MoonshineLaravelTranslation::getCountChanged())) + ->icon('heroicons.outline.language'), +``` + +## Credits + +- [Alex](https://github.com/alexvenga) + +## License + +The MIT License (MIT). Please see [License File](LICENSE) for more information.