PHP code example of badinansoft / nova-language-switch

1. Go to this page and download the library: Download badinansoft/nova-language-switch library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

badinansoft / nova-language-switch example snippets


// in app/Providers/NovaServiceProvider.php

// ...

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


  
  
return [  
  
	/**  
	 * List of languages that your application supports 
	 * array <string,  string>  
	 */  
	 'supported-languages' => [  
		  'en' => 'English',  
		  'ar' => 'Arabic',  
		  //here you can add new lanaguage or remove language that you need by 'local'=>'Label'
	 ],  
  
	/**  
	 * Languages That need RTL support 
	 *  string 
	 * */  
	'rtl-languages' => [  
		  'ar'  
		  //here put that language that need support RTL just put local of the language like this example for arabic 
		 
	 ],  
  
];

	/**  
	*  The application's route middleware groups. 
	*  @var array<string, array<int, class-string|string>>  
	*/  
	protected $middlewareGroups = [  
	  'web' => [  
			  //...
			  \Badinansoft\LanguageSwitch\Http\Middleware\LanguageSwitch::class  
	  ],
	  //...
	];
bash
php artisan vendor:publish --provider="Badinansoft\LanguageSwitch\ToolServiceProvider" --tag="config"