src/Inflector.php
public static function camelize($word)
    {
        $upper = function($matches) {
            return strtoupper($matches[0]);
        };
        $word = preg_replace('/([a-z])([A-Z])/', '$1_$2', $word);
        $camelized = str_replace(' ', '', ucwords(str_replace(['_', '-'], ' ', strtolower($word))));
        return preg_replace_callback('/(\\\[a-z])/', $upper, $camelized);
    }
public static function camelize($word)
    {
        $upper = function($matches) {
            return strtoupper($matches[0]);
        };
        $word = preg_replace('/([a-z])([A-Z])/', '$1_$2', $word);
        $camelized = str_replace(' ', '', ucwords(str_replace(['_', '-'], ' ', strtolower($word))));
        return preg_replace_callback('/(\\\[a-z])/', $upper, $camelized);
    }
public static function camelize ( $ word ) { $ upper = function ( $ matches ) { return strtoupper ( $ matches [ 0 ] ) ; } ; $ word = preg_replace ( '/([a-z])([A-Z])/' , '$1_$2' , $ word ) ; $ camelized = str_replace ( ' ' , '' , ucwords ( str_replace ( [ '_' , '-' ] , ' ' , strtolower ( $ word ) ) ) ) ; return preg_replace_callback ( '/(\\\[a-z])/' , $ upper , $ camelized ) ; }
Takes a under_scored word and turns it into a camelcased word.

@param  string  $word  An underscored or slugged word (i.e. `'red_bike'` or `'red-bike'`).
@param  array   $on    List of characters to camelize on.
@return string         Camel cased version of the word (i.e. `'RedBike'`).
Takes a under_scored word and turns it into a camelcased word .