Passing variable to route

I have a plethora of redirects I would like to generate somewhat dynamically.
My idea is to store them in an array like

$pagesFromOldSite = [
    [
        'pattern' => [ 'company-partners', 'partners', 'product/graph-databases' ],
        'target'  => 'about/ecosystem/partners',
    ],
    [
        'pattern' => [ 'publication', 'publications', 'research/publications' ],
        'target'  => 'about/ecosystem/publications',
    ],
];

—as that is more readable IMO—and then loop through them like this:

foreach ($pagesFromOldSite as $route):
    $routes[] = [
        'pattern' => $route['pattern'],
        'action'  => function() {
            $page = page($route['target']);
            if(!$page) $this->next();
            go($page, 301);
        }
    ];
endforeach;

where $routes is the array of all routes, of course.
This doesn’t work, obviously.
But can I pass $route['target'] as a variable to the action and if so, how?
I have tried 'action' => function($target = $route['target']) {, but to non avail.

Not sure how PHP binds its variables exactly here but what happens when you do

'action'  => function() use ($route) {

Does it pass always the correct $route for each loop iteration or to all actions the very last loop iteration?

That’s perfect, Nico!
I thought, I had tried that, thinking that it failed due to it passing the last loops $route, but I must have had something wrong.
Works perfectly now.
Many thanks!