Skip to content

visual-ideas/moonshine-laravel-translations

Repository files navigation

Laravel translations manager for MoonShine admin panel

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.