Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

FallOutBoi's avatar

How to stop laravel from stripping url

Hey guys, i am trying to build an app similar to IMDB for some reason laravel strips off cyrillic letters from the url, i was wondering is there any way i can prevent this?

my route is like this

Route::get('titles/{id}/{name}', 'TitleController@show')->middleware('prerenderIfCrawler');

the name stored in db is like Ford против Ferrari but the url reproduces like so https://mtdb.denisov.pro/titles/39/ford-ferrari. How can i prevent this?

0 likes
1 reply
FallOutBoi's avatar
return response()
    ->json($response, 200, ['Content-type'=> 'application/json; charset=utf-8'], JSON_UNESCAPED_UNICODE);

this fixed the issue

1 like

Please or to participate in this conversation.