namespace App\Http\Controllers;
class ExampleController extends Controller
{
public function index()
{
$sharedData = app('sharedData');
return view('example', [
'maxUploads' => $sharedData['max_uploads'],
'apiRateLimit' => $sharedData['api_rate_limit'],
'uploadsEnabled' => $sharedData['features']['uploads_enabled'],
]);
}
}
Alternatively, inject the shared data into the constructor: