I would like to know the best way to go about displaying a value from the database system wide in Laravel 5?
Basically, all authenticated users should have it set and I want to use it in a couple of places.
Thanks.
Without knowing too much about your setup/needs, I'd say you should create your own helpers file and put a simple function in there:
function special_value()
{
static $value;
if (is_null($value)) {
$value = DB::table('the_table')->value('the_column');
}
return $value;
}
Then, wherever you need the value, just call special_value()
to get it.