with previous laravel 5.5.16 version, i was storing json_encoded() fields to database (also json-datatyped fields) and retrieving them casted to collection by a model attribute casting.
i did composer update and got to laravel version 5.5.21, now, data is beeing stored differently and model's json-to-collection castings are not working.
_Model_
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Summon extends Model
{
protected $guarded = [];
protected $casts = [
'names' => 'collection',
];
}
using eloquent, i'm storing this array/json
[
"Siren",
"塞壬",
"세이렌",
"Sirène",
"Sirene",
"Sirena"
]
with this code:
_($summon['names'] contains the previous array)_
$newSummon = new Summon();
$newSummon->names = json_encode($summon['names']);
$newSummon->save();
previously, with version 5.5.16 it was stored like this

and whenever i retrieved it, i got the data casted to collection:

now, with version 5.5.22, it's beeing stored like this

and i get a string.

i'm retrieving it with this code
$summon = Summon::findOrFail($id);
return Response()->json($summon, Response::HTTP_OK);
this was the last test i did before posting this issue:
i stored the value using Query Builder (green box)
and got it working as before
The commented code within the red box used to work in 5.5.16 until i did composer update to 5.5.21

you may notice a bit more code in this last screenshot, i just shortened the code here to be more readable, this issue happens with every json field (like skill, color, entries) stored using eloquent and work as desired storing the using Query Builder.
I'm relatively new to laravel, hope i'm not skipping something 👍
Thank you!
i'm closing this, i found the issue is being caused by enconding a already encoded json
Most helpful comment
i'm closing this, i found the issue is being caused by enconding a already encoded json