我正在尝试将数组存储在配置文件`config/project_specific.php
<?php
return [
'sluggable_models1' => 'test_value', // works
'sluggable_models2' => ['features','packages'], // throws error
];
$models = config('project_specific.sluggable_models')
我在我的控制器中调用这个值
问题
只要变量是字符串,它就可以工作。当值是数组类型时,我收到此错误ErrorException in helpers.php line 515: htmlentities() expects parameter 1 to be string, array given (View: \resources\views\starter\admin\dashboard_admintools.blade.php)
去做
如何在我的 Laravel 5.3 应用程序中存储站点范围内可访问的数组?不一定是配置文件,但我更愿意避免使用 DB-fed 解决方案。