laravel-admin-extensions-caijiajia-my / multi-language
适用于laravel-admin的多语言支持扩展
0.0.3
2019-12-12 03:07 UTC
Requires
- php: >=7.0.0
- encore/laravel-admin: ~1.6
Requires (Dev)
- phpunit/phpunit: ~6.0
This package is auto-updated.
Last update: 2024-09-12 14:02:46 UTC
README
安装
composer require laravel-admin-extensions-fixed/multi-language
配置
首先,添加扩展配置
在 config/admin.php
'extensions' => [
'multi-language' => [
'enable' => true,
// the key should be same as var locale in config/app.php
// the value is used to show
'languages' => [
'en' => 'English',
'zh-CN' => '简体中文',
],
// default locale
'default' => 'zh-CN',
],
],
然后,将除外的路由添加到认证
在 config/admin.php
中,将 locale
添加到 auth.excepts
'auth' => [
...
// The URIs that should be excluded from authorization.
'excepts' => [
'auth/login',
'auth/logout',
// add this line !
'locale',
],
],