first you need to allow forward slash using the where on a route in a parameter (https://laravel.com/docs/10.x/routing#parameters-encoded-forward-slashes) like so:
Route::get('posts/{params}', function ($params) {
dd($params);
})->where('params', '.*');
and then you can explode the segments by a forward slash and assign the params respetively. you need to come up with the solution yourself, but should be pretty straightforward, something like
//for /posts/user/234/tag/obsolete
str($params)->explode('/')->chunk(2)->toArray();
/*
[
['user', '234'],
['tag', 'obsolete'],
]
*/
you can build on that, just do not forget to validate the parameter names and values