filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
18.09k stars 2.83k forks source link

brandLogo does not accept HTML string #9485

Closed bilogic closed 10 months ago

bilogic commented 10 months ago

Package

filament/filament

Package Version

781586a68ba1581344d6c02744e492be20ab51db

Laravel Version

10.30.1

Livewire Version

v3.1.0

PHP Version

8.1.20

Problem description

Passing HTML string directly did not work, instead what seems to be required is a view.

https://filamentphp.com/docs/3.x/panels/themes#adding-a-logo

 ->brandLogo(function () {
                return <<<'SVG'
                    <svg
                        viewBox="0 0 128 26"
                        xmlns="http://www.w3.org/2000/svg"
                        class="h-full fill-gray-500 dark:fill-gray-400"
                    >
                        <!-- ... -->
                    </svg>
                SVG;
            })

Expected behavior

SVG should render correctly

Steps to reproduce

Source code to replicate the issue provided above

Reproduction repository

Don't think it is needed, the short snippet recreates the problem

Relevant log output

I'm on a custom branch, so I specified the commit I'm based off.
That commit is less than 1 day old, so this problem still exists.
github-actions[bot] commented 10 months ago

Hey @bilogic! We're sorry to hear that you've hit this issue. 💛

However, it looks like you forgot to fill in the reproduction repository URL. Can you edit your original post and then we'll look at your issue?

We need a public GitHub repository which contains a Laravel app with the minimal amount of Filament code to reproduce the problem. Please do not link to your actual project, what we need instead is a minimal reproduction in a fresh project without any unnecessary code. This means it doesn't matter if your real project is private / confidential, since we want a link to a separate, isolated reproduction. That would allow us to download it and review your bug much easier, so it can be fixed quicker. Please make sure to include a database seeder with everything we need to set the app up quickly.

zepfietje commented 10 months ago

Make sure to return an HtmlString instance if you want to return it directly from the method.