Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

laravel , json Why it shows Cannot access offset of type string on string error

[
    'name' => "comments",
    'data' => [
        'comments' =>
            collect(json_decode($post['comments'], true))->map(function ($comment) {
                return [
                    'title' => $comment['attributes']['title'],
                    'message' => $comment['attributes']['message'],
                ];
            }),
    ]
],
 
PREVIOUS NEXT
Tagged: #laravel #json #Why #shows #Cannot #access #offset #type #string #string #error
ADD COMMENT
Topic
Name
6+8 =