error: Array to string conversion
i am getting the error 'Array to string conversion' in this code:
how do i fix this???
6 Replies
make sure that column has an
array cast
in your model, because you are using multiplewhere do i place the code?
protected $casts = [
'images' => 'array',
];
this code?
yes, in your model. If you are using Laravel 11
https://laravel.com/docs/11.x/eloquent-mutators#array-and-json-casting
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
no iam using 10. but somehow the image is not being saved now
did you upload it again?
this has been solved