skip to Main Content

Laravel – Auto fill object from json

I have a JSON: { "id":1, "name":"John", "firstname":"Doe" } Server side, I do it: $input = $request->json()->all(); $user = new User(); $user->id = $input['id']; $user->name = $input['name']; $user->firstname = $input['firstname']; Does it possible to auto fill my object with a…

VIEW QUESTION
Back To Top
Search