Dapatkan Basename tanpa ekstensi Laravel

use Illuminate\Support\Str;

$string = Str::of('/foo/bar/baz.jpg')->basename('.jpg');

// 'baz'
Zealous Zebra