Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. {"images": ["/user/57/house-11-1.png", "/use/57/house-12-2.png"]}
  2.  
  3. $path = $this->processImage($request, $user->id, $house->id);
  4. /* uploads the image to the server and pass path of the image*/
  5. if ($path) {
  6. $jsonstring = $house->images;
  7. dd($jsonstring);
  8. $arr = json_decode($jsonstring);
  9. $arr['images'] = [$path];
  10. $json = json_encode($arr);
  11. dd($json);
  12. $house->images = $json;
  13. $house->save();
  14. }
  15.  
  16. class userHouse extends Model implements Changeable
  17. {
  18. protected $casts = [
  19. 'images' => 'array',
  20. ];
  21. ...
  22. }
  23.  
  24. [2019-05-27 08:01:15] local.ERROR: Serialization of 'IlluminateHttpUploadedFile' is not allowed {"userId":57,"email":"info@test.com","exception":"[object] (Exception(code: 0): Serialization of 'Illuminate\Http\UploadedFile' is not allowed at /Users/dsfsdf/ah-website/user/laravel/framework/src/Illuminate/Session/Store.php:128)
  25. [stacktrace]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement