petehouston / translation-model
更新语言模型以修复Laravel 4.2中默认Waavi语言模型的兼容性问题。
dev-master
2014-12-16 15:41 UTC
Requires
- php: >=5.3.0
- illuminate/database: 4.2.*
- waavi/translation: *
This package is auto-updated.
Last update: 2024-09-27 22:26:42 UTC
README
由于Waavi/translation包已过时,作者似乎不再维护它。因此,我创建了此包以解决在Laravel 4.2中使用此包时的问题。
注意:此包仅适用于Laravel 4.2版本,不适用于Laravel 5,因为已删除SoftDeletingTrait。
使用方法
将以下内容添加到您的composer.json文件中,
"require": {
"petehouston/translation-model": "dev-master"
}
并运行composer命令来更新包。
$ composer update
您可能需要从Waavi/translation包中发布配置文件,
$ php artisan config:publish waavi/translation
现在编辑以下部分在app/config/packages/waavi/translation/config.php
/*
|--------------------------------------------------------------------------
| Language
|--------------------------------------------------------------------------
|
| Configuration specific to the language management component. You may extend
| the default models or implement their corresponding interfaces if you need to.
|
*/
'language' => array(
'model' => 'Language',
),
修改为以下内容
/*
|--------------------------------------------------------------------------
| Language
|--------------------------------------------------------------------------
|
| Configuration specific to the language management component. You may extend
| the default models or implement their corresponding interfaces if you need to.
|
*/
'language' => array(
'model' => 'Petehouston\Models\Language',
),
好了!您可以开始了。