Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel json decode response

controller:
 $formdone = FormResponse::where('task_id', '=', $task->id)->get();


blade:

@foreach ($formdone as $formcount)
@if(isset($formcount->task_id) && isset($formcount->form_id) && $task->id == $formcount->task_id  && $form->id == $formcount->form_id
||  isset($formcount->task_id) && isset($formcount->form_id) && $task->id == $formcount->task_id  && $form->id == $formcount->form_id
)
 <tr>
   <td scope="row"> {{ count((explode(',', json_encode($formcount->response)))) }}</td>
 </tr>
 @endif
@endforeach
 
PREVIOUS NEXT
Tagged: #laravel #json #decode #response
ADD COMMENT
Topic
Name
8+4 =