0

I'm sending a json request (on diffrent platforms) and can't getting the values with $request->all() function, as i expected. I have to validate name parameter with regex:/^[\p{L}]+$/ so it is not the case that i want. I must pass the request values to the Validator without any replacement.

Json Request example :

{
  "name": "guvuvıvıvöö",
  "surname": "bbbbbbbbbbbb",
  "phone": "+905544002218",
  "password": "123123123",
  "password_confirmation": "123123123",
  "dob": "2017-04-18",
  "gender": "1",
  "confirmationKey" : null
}

$request->all() function returns

array (size=8)
'name' => string 'guvuvvivöö' (length=12)
'surname' => string 'bbbbbbbbbbbb' (length=12)
'phone' => string '+905544002218' (length=13)
'password' => string '123123123' (length=9)
'password_confirmation' => string '123123123' (length=9)
'dob' => string '2017-04-18' (length=10)
'gender' => string '1' (length=1)
'confirmationKey' => null

Hope you can help me. if you want, i can share more code or information..

Farukest
  • 1,498
  • 21
  • 39
  • Are you using Laravel Valet? I have a similar issue here https://stackoverflow.com/questions/46730617/wrong-encoding-with-php Can you try the methods I tried? You can use `php artisan tinker` for try it – Lloople Oct 24 '17 at 21:47
  • I'm using Laravel with homestad not Valet. Should i try `php artisan tinker` still ? – Farukest Oct 24 '17 at 21:52
  • How is the JSON being generated? – Camilo Oct 24 '17 at 23:29
  • It doesn't matter how it is being generated because even if i manually create a json and send it with postman to the service. it is giving the same result. – Farukest Oct 24 '17 at 23:34
  • Yeah try that tinker commands from inside Homestead – Lloople Oct 25 '17 at 08:10

0 Answers0