Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. Route::post('/user', 'UserController@get');
  2.  
  3. function get(Request $request)
  4. {
  5. dd($request->input('Name Surname')); //display null
  6. dd($request->all()); //I notice the key's changed to Name_Surname
  7.  
  8. }
  9.  
  10. $data = $request->all()->mapWithKeys(function($item, $key) {
  11. return [str_replace("_", " ", $key) => $item];
  12. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement