Laravel 8 Str::singular() {#collection-method}
Str::singular
函数将字符串转换为单数形式。该函数目前仅支持英文:
use Illuminate\Support\Str;
$singular = Str::singular('cars');
// car
$singular = Str::singular('children');
// child
Str::singular
函数将字符串转换为单数形式。该函数目前仅支持英文:
use Illuminate\Support\Str;
$singular = Str::singular('cars');
// car
$singular = Str::singular('children');
// child