Routing pass urgent!

Routing code is as follows
$app->group(’/sliver/admin/’, function ($group) use(&$database) {
$group->get(‘updateLd’, \sliverAadmin::class .’:upadate_ld’);
});
How should I get $database in the upadate_ld method?

Better do not use this language construct use(&$database) to pass dependencies. I would recommend using the container in combination with constructor injection.