namespace App\Http\Controllers;
use Illuminate\Support\Facades\View;
class ExampleController extends Controller
{
public function index()
{
$globalPreferences = View::shared('globalPreferences');
return view('example', [
'apiLimit' => $globalPreferences['api_limit'],
'appMode' => $globalPreferences['app_mode'],
]);
}
}
If the data needs to change during the application lifecycle (e.g., a feature toggle), you can update it dynamically.