Laravel 8 Str::replaceLast() {#collection-method}
Str::replaceLast
函数替换字符串中最后一次出现的给定值:
use Illuminate\Support\Str;
$replaced = Str::replaceLast('the', 'a', 'the quick brown fox jumps over the lazy dog');
// the quick brown fox jumps over a lazy dog