I want calculate time different between 2 row and calculate rank. this is my code:
 public function testtima($sid,$rid){
        $calcs=users::where([['si',$sid]])->first();
        $calcr=users::where([['ri',$rid]])->first();
        $stime=$calcs['created_at'];
        $rtime=$calcr['created_at'];
        $show['stime']=$stime;
        $show['rtime']=$rtime;
        $show['now']=carbon::now();
        return $show;
    }
how can i calculate $rtime-$stime ?