How can I convert json to a Laravel Eloquent Model?
问题 if I have an Eloquent Model called Post, and the mysql table has: integer ID, string Text How do I convert this JSon: { post: { text: 'my text' } } To the relevant Post object that, once received in the controller, I can save to the database like this: public function store(Post $post) { $post->save(); } I'm not looking to build the logic that would do that for me, but for the Laravel way (or could it be that there isn't one? I googled it with no relevant results). 回答1: Convert json to array