Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Htmlable contents in BaseElement #215

Merged
merged 4 commits into from
Apr 19, 2024

Conversation

hemmesdev
Copy link

I've recently update to laravel/framework 10.19.0 and noticed that it breaks on of my components.
Error message is: The given child should implement Spatie\Html\HtmlElement or be a string

My component looks like this:

<!-- Send button -->
<div class="row form-group text-center">
    <div class="col-lg-12">
        {{
            html()
                ->submit($slot)
                ->class(['btn', 'btn-primary'] + (($disabled ?? false) ? ['disabled'] : []))
                ->class($class ?? [])
                ->id($id ?? 'submit')
                ->attribute(isset($form) ? 'form' : '', $form ?? '')
                ->disabled(($disabled ?? false) ? "disabled": "")
        }}
    </div>
</div>

And i use it like this:

@component('fc::submit')
       {{ __('save') }}
@endcomponent

This is my fix for the problem. also reported here: #193

@freekmurze
Copy link
Member

Could you remove the code styling changes from this PR so the actual change is visible?

@hemmesdev
Copy link
Author

Updated

@hemmesdev
Copy link
Author

@freekmurze any comments?

@freekmurze freekmurze merged commit f3cac70 into spatie:main Apr 19, 2024
@freekmurze
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants