d13r/laravel-breadcrumbs

I've added support for Bootstrap 4

mstnorris opened this issue · 7 comments

Here is the code to support bootstrap 4. Sorry I don't have time to submit a pull-request but this is the newer markup. If someone, or yourself, has time to implement it, I'm sure others will appreciate it.

I've also added the $breadcrum->icon which is sent through the the data-icon attribute from the app/Http/breadcrumbs.php file. Feel free to remove or separate it.

Thanks

<nav class="breadcrumb">
    @foreach ($breadcrumbs as $breadcrumb)
        @if (!$breadcrumb->last)
            <a class="breadcrumb-item" href="{{ $breadcrumb->url }}">
                @if ( isset($breadcrumb->icon) )
                    <i class="fa {{ $breadcrumb->icon }}"></i>
                @endif
                {{ $breadcrumb->title }}
            </a>
        @else
            <span class="breadcrumb-item active">
                @if ( isset($breadcrumb->icon) )
                    <i class="fa {{ $breadcrumb->icon }}"></i>
                @endif
                {{ $breadcrumb->title }}
            </span>
        @endif
    @endforeach
</nav>
d13r commented

Thanks. I'll wait until Bootstrap 4 is released (or at least stable) before including it though.

Sure, just thought that although it is only small changes, and that Bootstrap is now in Alpha-3 that it would be useful.

d13r commented

It is useful, thanks - just I don't want to release it then have them change it is all. I'd like to keep this issue open as a reminder though, if you don't mind.

v4 should soon be out of alpha - twbs/bootstrap#20631

d13r commented

Laravel Breadcrumbs is no longer officially maintained
Please see the README file for further details.

@mstnorris: can you give more detail?

I've also added the $breadcrumb->icon which is sent through the the data-icon attribute from the app/Http/breadcrumbs.php file. Feel free to remove or separate it.

d13r commented

I’ve decided to start working on Laravel Breadcrumbs again.

Bootstrap 4 support will be added in v4 - but without the icons and with <ol> rather than <nav>.