Hi, i have been working for this project for a couple of weeks now but i cant seem to find the solution for it. So basically i want to view the details of each 'test_suite' data that i have in my DB but it always return a blank collection.
So basically this is my model
public function testDetails($case_id)
{
return DB::table('test_executions as e')
->select('h.name as host','e.*','b.*','c.name as case')
->rightJoin('test_cases as c','e.case_id','=','c.id')
->rightJoin('build_versions as b','e.build_id','=','b.id')
->rightJoin('test_hosts as h','e.host_id','=','h.id')
->where('c.case_id',$case_id)
->get();
}
This is my controller for it
public function details($case_id)
{
$data=[
'case'=>$this->Results->testDetails($case_id),
];
dump($data);
return view ('overview_details',['test_data'=>$data]);
}
The route to point out to the correct id
Route::get('/overview_details/{case_id}', [ResultsController::class,'details']);
And finally this is my view page
@foreach ($test_data['case'] as $value)
<tr>
<th scope="row" class='col-3'><a href="/details">{{$value->case}}</a></th>
<td class='col-4'>{{$value->branch}}</td>
<td class='col-2'>{{$value->version}}</td>
<tr>
@endforeach
And the current results is an empty collection like this
array:1 [▼
"case" => Illuminate\Support\Collection {#291 ▼
#items: []
}
]
Any help is appreciated. Thanks!