如何从数据库阵列中检索数据设置以在Laravel 5中进行全局访问

How to retrieve global settings from database table ? I know how to create global settings in array like this: path:

app/config/settings.php

<?php
return array(
        'admin_email' =>'mail@shabeebk.com',
        'admin_name' =>'Admin',
);

and in controller:

$cvalue = Config::get('settings.admin_name');

I'd like to achive the same effect but this time data receive from table settings

$data = Settings::get();

return as array and have globally acces to them.

查看全部
dongzhiju0324
dongzhiju0324
2017/01/24 18:26
  • laravel
  • php
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复