Laravel 8 before {#collection-method}
before
方法返回字符串中指定值之前的所有内容:
use Illuminate\Support\Str;
$slice = Str::of('This is my name')->before('my name');
// 'This is '
before
方法返回字符串中指定值之前的所有内容:
use Illuminate\Support\Str;
$slice = Str::of('This is my name')->before('my name');
// 'This is '