7 months ago

How to create protfolo with isotope with laravel

Posted 7 months ago by oxbir

I have a categories table , I want to create like this site . http://onepage-d7.demo.weebpal.com/#panel-second-wrapper

public function gallery()
    $galleries = Gallery::whereNotNull('image')->latest()->paginate(25);
    $catCommittee = Category::where('parent_id',16)->get();
    $categories = Category::where('parent_id', 42)->get();
    return view('Home.galleries', compact('galleries','catCommittee', 'categories'));


<div class="container">
    <h2 class="mt-3 mb-3">{{ __('message.menu.galleries') }}</h2>
    <div class="row">
        <div class="container-fluid" style="margin-top:20px;">
            <div class="row">
                <ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
                    @foreach($categories as $category)

                        <li class="nav-item">
                            <a class="nav-link"  id="isotope-{{ $category->id }}-tab" data-toggle="pill"                                         href="#isotope-{{ $category->id }}" role="tab" aria-controls="isotope-{{ $category->id }}" aria-selected="false">{{ $category->name }}</a>
            </div><hr noshade style="margin-top:-20px;">
            <div class="container grid">
                <div class="tab-content" id="pills-tabContent">

                    @foreach($categories as $key=>$category)
                        <?php $ok = false;?>
                        @foreach($category->galleries as $key=>$gallery)
                            <?php $ok = true;?>
                           @if(count($category->galleries) == 1 || $key == 0)

                            <div class="tab-pane fade" id="isotope-{{  $gallery->pivot->category_id }}" role="tabpanel" aria-labelledby="isotope-{{ $gallery->pivot->category_id }}-tab">
                                <div class="Portfolio">
                                    <a href="#!">
                                        <img class="card-img" src="{{ $gallery->image }}" alt="">
                                    <div class="desc">{{ $gallery->title }}</div>
                                @if(count($category->galleries) == 1 || count($category->galleries) == ++$key)
                                <div class="tab-pane fade" id="isotope-{{  $category->id }}" role="tabpanel" aria-labelledby="isotope-{{ $category->id }}-tab"></div>

Please sign in or create an account to participate in this conversation.