creating tables
This commit is contained in:
@@ -8,8 +8,6 @@ use Log;
|
||||
|
||||
class Str extends \Illuminate\Support\Str
|
||||
{
|
||||
protected static $cty_snake_cache = [];
|
||||
|
||||
/**
|
||||
* Split and trim
|
||||
*
|
||||
@@ -26,31 +24,6 @@ class Str extends \Illuminate\Support\Str
|
||||
return array_map('trim', self::split($haystack, $delimiters));
|
||||
}
|
||||
|
||||
/**
|
||||
* Customized snake case for cty aliases
|
||||
*
|
||||
* @param $camel
|
||||
* @return string
|
||||
*/
|
||||
public static function snakeAlias($camel)
|
||||
{
|
||||
if (isset(static::$cty_snake_cache[$camel]))
|
||||
return static::$cty_snake_cache[$camel];
|
||||
|
||||
$c = $camel;
|
||||
|
||||
$c = preg_replace_callback('/([A-Z0-9]+)(?![a-z])/', function ($m) {
|
||||
return ucfirst(strtolower($m[1]));
|
||||
}, $c);
|
||||
|
||||
$c = self::snake($c, '_');
|
||||
|
||||
// fix for underscores in cty class name
|
||||
$c = preg_replace('/_+/', '_', $c);
|
||||
|
||||
return static::$cty_snake_cache[$camel] = $c;
|
||||
}
|
||||
|
||||
/**
|
||||
* Split a string using one or more delimiters
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user