Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

DurgeshJha's avatar

required structure and code to be use for taking attendance from the table

I have require the structure and code used on controller/routes and blade to be use for taking attendance of 500 students from the table and show it to the blade view. Any help will be appreciated.

0 likes
4 replies
mushood's avatar
mushood
Best Answer
Level 41

@DurgeshJha Hello, your question is quite unclear.

I can understand that you have a Student Model and you want to retrieve your records and display it? Am i correct?

DurgeshJha's avatar

Thanks @mushood , I did it but i have to retrive data for fetching into multi chart format which i am unable to to lets take a look of my code:

$item = DB::table('attendances') ->select(DB::raw('month as month'), DB::raw('count(day) as day')) ->where('student_id', $id) ->where('day','Present') ->groupBy('month') ->orderby('month','DESC') ->get() ->toarray();

 $item1 = DB::table('attendances')
->select(DB::raw('month as month'), DB::raw('count(day) as day'))
         ->where('student_id', $id)
        ->where('day','Absent')
        ->groupBy('month')
        ->orderby('month','DESC')
        ->get()
        ->toarray();

I have to payy arrey value of $item and $item1 in this chart, chart:

$chart1= Charts::multi('bar', 'highcharts') ->responsive(false) ->dimensions(400, 200) ->colors(['#ff0000', '#00ff00', '#0000ff']) ->labels(['One', 'Two', 'Three']) ->dataset('Test 1', [1,2,3]) ->dataset('Test 2', [0,6,0]) ->dataset('Test 3', [3,4,1]);

Pls suggest how to to so that chart could render properly

Please or to participate in this conversation.