use Illuminate\Support\Str;
$converted = Str::camel ('foo_bar');
// fooBar
Laravel5.5 及以前使用 camel_case
Str::snake 函数将给定的「驼峰式」字符串转化为 snake-case「短横式」字符串:
use Illuminate\Support\Str;
$converted = Str::snake ('fooBar');
// foo_bar
Laravel5.5 及以前使用 snake_case