laravel eloquent: TypeError: Cannot access offset of type array on array in