How do I use a package language file?

回眸只為那壹抹淺笑 提交于 2019-12-05 04:03:22
antoniputra

Same like you call view and config:

// for lang
Lang::get('package::routes.foo')
// or with shortcut func
trans('package::routes.foo')

// for view
View::make('package::view.name');

// for config
Config::get('package::group.option');

What you need to do is to remove vendor/ but leave package.

You can see more at the Laravel documentation on: package conventions.

====

UPDATE

in laravel 5 you can call view and config like this :

// for view (shorthand)
view('path_to_view', array('data' => 'somedata'));

// for config
config('config.name', 'default');
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!