[Vuejs]-How to loop through JSON Object in vue js

0👍

I think you should use something like this in your Laravel controller, and then it would be easier to use loop to output json

 $tasks = Task::select('tasks_status', DB::raw("group_concat(CONCAT('{\"id\":\"',id,'\",\"name\":\"',name,'\"}') ) as subrow"))
                    ->where('tasks_status', '<>', "Sent Tasks")
                    ->whereNull('user_id')
                    ->orderBy('id', 'desc')
                    ->groupBy('tasks_status')
                    ->get()->map(function ($e) {
                          $e->subrow = json_decode($e->subrow);
                          return $e;
                     });

Leave a comment