visual-ideas / moonshine-laravel-translations
Manage Laravel translation files with MoonShine admin panel
1.1.0
2023-09-27 08:50 UTC
Requires
- php: ^8.0|^8.1|^8.2
- ext-json: *
- laravel/framework: ^9.21|^10.0
- moonshine/moonshine: ^1.60
- spatie/laravel-translatable: ^6.5
- visual-ideas/moonshine-spatie-translatable: ^1.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.21
README
Installation
You can install the package via composer:
composer require visual-ideas/moonshine-laravel-translations
You must run the migrations with:
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --provider="VI\MoonShineLaravelTranslations\Providers\MoonShineLaravelTranslationsServiceProvider" --tag="config"
This is the contents of the published config file:
TODO Config info
Add new MoonShine resource to your MoonShineServiceProvider file, like this:
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
License
The MIT License (MIT). Please see License File for more information.