Answer the question
In order to leave comments, you need to log in
How to transfer this route to laravel?
The Klein router uses this
pattern $route->respond('GET', '/[*:path]/[*:name]/[200x150|600x450|1200x900:size]');
How can you implement something similar in Laravel without creating a bunch of routes with different size parameters, and the $path variable could contain segments with a slash (example: /images/122/122)
Answer the question
In order to leave comments, you need to log in
Route::get('/{path}/{name}/{size}', function($path, $name, $size){
echo implode('/', [$path, $name, $size]);
})->where([
'path' => '(.*)',
'size' => '(200x150|600x450|1200x900)'
]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question