app/Http/Controllers/HomeController.php
//sort based on patient's lastname 
sort based on patient's lastname
sort based on patient ' s lastname
public function sort_lastname(){
        $patients = Patient::all()->toArray();
        usort($patients, array($this , "compare_lastname"));
        return $patients;
    }
public function sort_lastname ( ) { $ patients = Patient :: all ( ) -> toArray ( ) ; usort ( $ patients , array ( $ this , " compare_lastname " ) ) ; return $ patients ; }
sort based on patient's lastname
sort based on patient ' s lastname