在laravel中查看共享所有设置表是一种好习惯吗?

I created settings table like this.

id key value 1 title title of the website 2 description some text

And i did this in the base controller

public function __construct(){
    $settings = TSettings::all();
    View::share('settings', $settings);
}

Is it a good practice or not? and please if not why?

There's nothing wrong with using View share for all settings if you need them on all requests.

However, accessing them by index is bad. Don't rely on your database always being in the same default order.

Instead either use the ->where(settingKey, settingName)/some other collection method to access them or share them as separate variables for each setting.