visual-ideas/moonshine-laravel-translations

Manage Laravel translation files with MoonShine admin panel

1.1.0 2023-09-27 08:50 UTC

This package is auto-updated.

Last update: 2024-11-27 11:21:16 UTC


README

Latest Version on Packagist Total Downloads

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.