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

Support Fragment directive #99

Closed
inmanturbo opened this issue Aug 28, 2023 · 0 comments · Fixed by #100
Closed

Support Fragment directive #99

inmanturbo opened this issue Aug 28, 2023 · 0 comments · Fixed by #100
Assignees

Comments

@inmanturbo
Copy link
Contributor

It would be really nice to have fragments.

Something like:

<?php

use function Laravel\Folio\{fragmentIf};

fragmentIf(request()->hasHeader('HX-Request'), 'user-list');
?>

@fragment('user-list')
    <ul>
        @foreach ($users as $user)
            <li>{{ $user->name }}</li>
        @endforeach
    </ul>
@endfragment

https://laravel.com/docs/10.x/blade#rendering-blade-fragments

Thoughts?

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

Successfully merging a pull request may close this issue.

3 participants