PHPackages                             elsayed85/nova-language-switch - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. elsayed85/nova-language-switch

ActiveLibrary

elsayed85/nova-language-switch
==============================

A Laravel Nova package to switch language in your application

01PHP

Since Jan 14Pushed 3y agoCompare

[ Source](https://github.com/elsayed85/nova-language-switch)[ Packagist](https://packagist.org/packages/elsayed85/nova-language-switch)[ RSS](/packages/elsayed85-nova-language-switch/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

A Laravel Nova Tool to add language switcher to your application
----------------------------------------------------------------

[](#a-laravel-nova-tool-to-add-language-switcher-to-your-application)

This [Nova](https://nova.laravel.com) tool lets you:

- Add a Language switcher to the header of the nova application.
- Handle Switch language and put the current locale to Laravel cache to remember language from multiple browsers.
- Switch the direction of the application based on the RTL-supported application written in config.

Requirements
------------

[](#requirements)

- `php: >=8.0`
- `laravel/nova: ^4.0`

    > ```
    >  Note: This package dose't work with nova 3
    >
    > ```

Features
--------

[](#features)

- Add multiple languages from the config.
- Remember set local based on cache no need to save in the database table
- Auto inject to the header of the application
- Just 4 steps to setup

Screenshot
----------

[](#screenshot)

|[![enter image description here](https://raw.githubusercontent.com/badinansoft/nova-language-switch/master/docs/en-screenshot.png)](https://raw.githubusercontent.com/badinansoft/nova-language-switch/master/docs/en-screenshot.png) |[![enter image description here](https://raw.githubusercontent.com/badinansoft/nova-language-switch/master/docs/ar-screenshot.png)](https://raw.githubusercontent.com/badinansoft/nova-language-switch/master/docs/ar-screenshot.png) |

Installation
------------

[](#installation)

You can install the nova tool in to a Laravel app that uses [Nova](https://nova.laravel.com) via composer:

```
composer require badinansoft/nova-language-switch
```

Next up, you must register the tool with Nova. This is typically done in the `tools` method of the `NovaServiceProvider`.

```
// in app/Providers/NovaServiceProvider.php

// ...

public function tools()
{
    return [
        // ...
        new \Badinansoft\LanguageSwitch\LanguageSwitch(),
    ];
}
```

Next up, must you publish the config file with for add your languages:

```
php artisan vendor:publish --provider="Badinansoft\LanguageSwitch\ToolServiceProvider" --tag="config"
```

This is the contents of the published config file:

```
