Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {"images": ["/user/57/house-11-1.png", "/use/57/house-12-2.png"]}
- $path = $this->processImage($request, $user->id, $house->id);
- /* uploads the image to the server and pass path of the image*/
- if ($path) {
- $jsonstring = $house->images;
- dd($jsonstring);
- $arr = json_decode($jsonstring);
- $arr['images'] = [$path];
- $json = json_encode($arr);
- dd($json);
- $house->images = $json;
- $house->save();
- }
- class userHouse extends Model implements Changeable
- {
- protected $casts = [
- 'images' => 'array',
- ];
- ...
- }
- [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)
- [stacktrace]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement