How to add Limit to the query in cakephp need help? it's using server side proccessing data-table implement in cakephp

I have more than 50,000 records i want get an json as limit 10 records to put into data-table so how can put the sql query into cakephp Here is my code : -

$this->autoRender= false;
    
    // ini_set('memory_limit','-1');
    $request=$_REQUEST;

    $draw = $request['draw'];
    $page = intval($request['start']);
    $offset = intval($request['length']);
    
    // $sLimit = "";
        if ( ( $page  > 0 ) && ( $offset) ) {
     
    // if ( isset( $request['start'] ) && $request['length'] != '-1' ) {

        // $sLimit = " LIMIT ".intval( $request['start'] ).", ".intval( $request['length'] );
        $sql = $this->Leads->find()->limit($offset)->page($page)->toArray();

    }

    else {

        // $sLimit = " LIMIT 0, 10";
        $sql = $this->Leads->find()->limit($offset)->order(['id' => 'ASC'])->toArray();

    }  
            

    //$sql = $this->Leads->find()->limit(10)->toArray();
    $col =array(
        0   =>  'id',
        1   =>  'company_name',
        2   =>  'contact_name_first',
        3   =>  'contact_name_last',
        4   =>  'phone_no',
        // 5   =>  'email',
        6   =>  'city',
        7   =>  'state',
        8   =>  'zip_code',
        // 9   =>  'description_of_work'

    );  //create column like table in database
    //$sql ="SELECT * FROM tbperson";
    // $sql = $this->Leads->find()->limit(20)->toArray();

    
     
     $count = $this->Leads->find()->count();
                               
             
     $totalData = $count;
     
    $totalFilter=$totalData;
    
   // $sql ="SELECT * FROM tbperson WHERE 1=1";
    // $sql = $this->Users->find("all")->where([1=>1])->toArray();
    // if(!empty($request['search']['value'])){
    //     $sql.=" AND (id Like '".$request['search']['value']."%' ";
    //     $sql.=" OR company_name Like '".$request['search']['value']."%' ";
    //     $sql.=" OR contact_name_first Like '".$request['search']['value']."%' ";
    //     $sql.=" OR contact_name_last Like '".$request['search']['value']."%' )";

    // }
    
    $totalData= $count;
    
    // $sql.=" ORDER BY ".$col[$request['order'][0]['column']]."   ".$request['order'][0]['dir']."  LIMIT ".
        // $request['start']."  ,".$request['length']."  ";
    
    

             $data=array();
            foreach ($sql as $key => $value) {
      
                $subdata=array();
                $subdata[]=$value->id; 
                $subdata[]=$value->company_name; 
                $subdata[]=$value->contact_name_first; 
                $subdata[]=$value->contact_name_last; 
                $subdata[]=$value->phone_no; 
                // $subdata[]=$value->email; 
                $subdata[]=$value->city; 
                $subdata[]=$value->state;
                $subdata[]=$value->zip_code;
                // $subdata[]=$value->description_of_work;        
                  //create event on click in button edit in cell datatable for display modal dialog           $row[0] is id in table on database
                 $subdata[]='<button type="button" id="getEdit" class="btn btn-primary btn-xs" data-toggle="modal" data-target="#myModal">Edit</button>';
                $data[]=$subdata;
                }

                $json_data=array(
                    "draw"              =>  $draw,
                    "recordsTotal"      =>  $totalData,
                    "recordsFiltered"   =>  $totalFilter,
                    "data"              =>  $data,
                    // "page"              =>  $page,
                    // "offset"            =>  $offset
                );
                echo json_encode($json_data);