public static function find($id, $columns = array('*'))
    {
        $key = (new static)->getKeyName();
        if (ctype_print($id)) {
            $idFinal = (property_exists(static::class, 'uuidOptimization') && static::$uuidOptimization)
            ? self::toOptimized($id) : hex2bin($id);

            return static::where($key, '=', $idFinal)->first($columns);
        } else {
            return parent::where($key, '=', $id)->first($columns);
        }
    }
public static function find($id, $columns = array('*'))
    {
        $key = (new static)->getKeyName();
        if (ctype_print($id)) {
            $idFinal = (property_exists(static::class, 'uuidOptimization') && static::$uuidOptimization)
            ? self::toOptimized($id) : hex2bin($id);

            return static::where($key, '=', $idFinal)->first($columns);
        } else {
            return parent::where($key, '=', $id)->first($columns);
        }
    }
public static function find ( $ id , $ columns = array ( '*' ) ) { $ key = ( new static ) -> getKeyName ( ) ; if ( ctype_print ( $ id ) ) { $ idFinal = ( property_exists ( static :: class , 'uuidOptimization' ) && static :: $ uuidOptimization ) ? self :: toOptimized ( $ id ) : hex2bin ( $ id ) ; return static :: where ( $ key , '=' , $ idFinal ) -> first ( $ columns ) ; } else { return parent :: where ( $ key , '=' , $ id ) -> first ( $ columns ) ; } }
Modified find static function to accept both string and binary versions of uuid
@param  mixed $id       The id (binary or hex string)
@param  array $columns  The columns to be returned (defaults to *)
@return mixed           The model or null
Modified find static function to accept both string and binary versions of uuid