creating tables

This commit is contained in:
2018-07-21 23:07:41 +02:00
parent 75afc67f31
commit 26488e5883
15 changed files with 215 additions and 48 deletions
-27
View File
@@ -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
*