paginate() is only available on Eloquent results and Query Builders.
I'm assuming $rc is a collection.
https://laravel.com/docs/5.1/pagination#manually-creating-a-paginator
Try this instead:
private function ResultWithSTDsRegid($input, $rc)
{
$rc = $rc->where('Regid', CompleteRegid($input['Regid']))
->where('ExamYear', $input['ExamYear'])
->where('Courseid', $input['course'])
->where('Examtype', $input['Examtype'])
->where('CLM','0')
->get();
return new \Illuminate\Pagination\Paginator( $rc, 5 );
}
Alternately, you can return a LengthAwarePaginator, but you have to provide the length of the collection:
return new \Illuminate\Pagination\LengthAwarePaginator( $rc, count($rc), 5 );