From 940bfb97ef92057a0a47628ea6d851a096874615 Mon Sep 17 00:00:00 2001 From: Shaharyar Ahmed Date: Thu, 5 Mar 2026 23:43:12 +0500 Subject: [PATCH] Refactor SVG handling for loading indicator Refactor loading indicator SVG handling to use a custom SVG if configured otherwise use default SVG. Signed-off-by: Shaharyar Ahmed --- packages/support/src/helpers.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/support/src/helpers.php b/packages/support/src/helpers.php index 90559baec79..c94d5e5d4a4 100644 --- a/packages/support/src/helpers.php +++ b/packages/support/src/helpers.php @@ -206,7 +206,7 @@ function generate_loading_indicator_html(?ComponentAttributeBag $attributes = nu "fi-size-{$size->value}", ]); - return new HtmlString(<< - HTML); + HTML; + + $svg = config('filament.loading_indicator_svg'); + + if ($svg) { + return new HtmlString(str_replace('__attributes__', $attributes->toHtml(), $svg)); + } + + return new HtmlString($defaultSvg); } }