lpuddu/laravel-translations-dashboard

This package is abandoned and no longer maintained. No replacement package was suggested.

A panel for managing database translations in Laravel.


README

Note: as new Laravel version keep coming out, this package is not actively mantained anymore. It might receive bug fixes, but won't be kept up to date.

Laravel Translations Dashboard

Latest Version on Packagist Total Downloads

This package is a full-featured translations dashboard for laravel 5.7+.

You will have a ready-to-use dashboard to manage multilingual translation keys, to be loaded in your website with the Laravel native helpers (__(), trans() and @lang()).

The package combines the best features of two popular packages, namely spatie\laravel-permission and Waavi/translation.

Installation

Via Composer

composer require lpuddu/laravel-translations-dashboard

Usage

Once installed, publish assets folder, migrations and config files by running:

php artisan translations-dashboard:init

You can also customize the views by publishing them:

php artisan vendor:publish --provider="LPuddu\LaravelTranslationsDashboard\LaravelTranslationsDashboardServiceProvider" --tag="laravel-translations-dashboard.views"

When published, the config/laravel-translations-dashboard.php config file contains:

return [
    /**
         * The prefix applied to all the routes, eg. /translations/home
         */
        'prefix' => 'translations',
    
        /**
         * The route used to logout translators
         */
        'logout_route' => 'translations/logout',
    
        /**
         * The guard to use for permissions
         */
        'guard' => 'web',
    
        /**
         * The list of middlewares that all routes should use.
         * You can use this to authenticate users into the dashboard via the appropriate middleware.
         */
        'middlewares' => ['web', 'auth']
];

Remove your config cache:

php artisan config:clear

Execute the database migrations:

php artisan migrate

By default, the package adds four permissions (manage-languages, manage-pages, manage-settings, translate). Without permissions, you will only be able to login into the dashboard without doing much.

Make sure that your user has a HasRoles trait, then add the relevant permissions to start working.

$user->givePermissionTo('translate', 'manage-pages');

The change will be reflected immediately on your database. Check the spatie\laravel-permission documentation to explore more possibilities.

Security

If you discover any security related issues, please use the issue tracker on github or email me at info__at__lucapuddu.com

Credits

License

MIT. Please see the license file for more information.