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