V
V
Vladislav2015-10-27 16:45:13
Laravel
Vladislav, 2015-10-27 16:45:13

How to add percent sign in laravel 5.* route pattern?

There is such a route "Blore%27s_Razor" and the pattern $router->pattern('author', '[-a-zA-Z0-9_%]+'), but it doesn't work, laravel throws not found http exception. This is because of the percent sign, because other routes that do not have it work fine. When I search for the usual preg_match, the pattern works. How to solve it? Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Evgrafovich, 2015-10-27
@MrBikus

Route::pattern('author', '[-a-zA-Z0-9_\']+');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question