Skip to content

Commit

Permalink
Use Str::removeLeft()
Browse files Browse the repository at this point in the history
  • Loading branch information
marcorieser committed Jan 21, 2025
1 parent f59ad35 commit b11efda
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Assets/AssetContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Statamic\Facades\Stache;
use Statamic\Facades\URL;
use Statamic\Support\Arr;
use Statamic\Support\Str;
use Statamic\Support\Traits\FluentlyGetsAndSets;

class AssetContainer implements Arrayable, ArrayAccess, AssetContainerContract, Augmentable
Expand Down Expand Up @@ -139,10 +140,7 @@ public function url()
}

$url = rtrim($this->disk()->url('/'), '/');

if (str_starts_with($url, config('app.url'))) {
$url = substr($url, strlen(config('app.url')));
}
$url = Str::removeLeft($url, config('app.url'));

return ($url === '') ? '/' : $url;
}
Expand Down

0 comments on commit b11efda

Please sign in to comment.