1
I’m having this error in the Standard when trying to fetch data from my database:
Errorexception: unserialize(): Error at offset 0 of 9947 bytes in file
Controller:
public function show(Request $request)
{
$animaisAdocao = animalAdocao::where('id_usuario', $request->id)->get();
for($i = 0; $i < count($animaisAdocao); $i++){
$animaisAdocao[$i]['sociabilidade'] = unserialize($animaisAdocao[$i]['sociabilidade']);
$animaisAdocao[$i]['temperamento'] = unserialize($animaisAdocao[$i]['temperamento']);
$animaisAdocao[$i]['complementos'] = unserialize($animaisAdocao[$i])['complementos'];
}
return response()->json($animaisAdocao);
}
My route:
Route::get('animalAdocao/{id}', 'AnunciaAdocaoController@show');
My data in the comic book: