There is the following code
$relations = PR::where('status','1') ->whereIn('id',array($PR['related'])) ->get();
The fact is that the query returns only 1 element, if you insert such a query, it will output all 3 elements
$relations = PR::where('status','1') ->whereIn('id',array(1,2,3)) ->get();
Why is this happening? considering that $ PR ['related'] is 1,2,3