Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Zoul's avatar
Level 5

Unable to find component: [blog-list]

Hi all,

I guess the path to Blog model and to the view livewire.blog-list however its not finding it.

BlogList livewire

namespace App\Http\Livewire;

use Livewire\Component;
use Livewire\WithPagination;
use App\Models\Blog;
use Hashids\Hashids;
class BlogList extends Component
{
    use WithPagination;
    protected $paginationTheme = 'bootstrap';
    public function render()
    {
        $hash = new Hashids('', 10); // pad to length 10
        $blogs = Blog::paginate(6);
        return view('livewire.blog-list',compact('blogs','hash'));
    }
}

in livewire.blog-list

<div>
    <!-- Blog -->
   <section class="blog-area three ptb-100">
       <div class="container">
            <div class="row">
                <div class="col-12">
                    <div class="row">
                        @if($blogs && $blogs-> count() > 0)
                            @foreach ($blogs as $blog)
                                <div class="col-md-6 col-sm-6 col-lg-4">
                                    <div class="blog-item">
                                        <div class="top">
                                             <a target="_blank" href="{{ $blog->photo}}">
                                                <img src="{{ $blog->photo}}" alt="blog" style="width: 510; height:450" 						title="{{ $blog->title}}" alt="{{ $blog->title}}">
                                            </a>
                                        </div>
                                        <div class="bottom">
                                            <ul>
                                                <li>
                                                    <i class="icofont-calendar"></i>
                                                    <span>{{ Date::parse($blog->created_at) ? Date::parse($blog->created_at)->diffForHumans() : ''}}</span>
                                                </li>
                                                <li>
                                                    <i class="icofont-user-alt-3"></i>
                                                    <span>{{ trans('front/message.By') }}:</span>
                                                    <a href="#">{{ $blog->user->name}}</a>
                                                </li>
                                            </ul>
                                            <h3>
 
                                                <a href="{{ url('blog/details/'.str_replace_me($blog->title).'/'.$hash-						>encodeHex($blog->id))}}" title="{{ $blog->title}}">{{ $blog->title}}</a>
                                            </h3>
                                            <p>{{ $blog->short_description }}</p>
                                            <a class="blog-btn" href="{{ url('blog/details/'.str_replace_me($blog-							>title).'/'.$hash->encodeHex($blog->id))}}" title="{{ $blog-						>title}}">{{ trans('front/message.Read More') }}</a>
                                        </div>
                                    </div>
                                </div>
                            @endforeach
                        @endif
                    </div>
                    <div class="pagination-area">
                        <ul>
                      
                            <li>
                                {{ $blogs->links() }}
                            </li>
                        </ul>
                    </div>
                </div>

            </div>
       </div>
   </section>
   <!-- En

in my view the blog.inbox.blade.php which is calling the livewire.blog-list

 <!-- Page Title -->
        <div class="page-title-area title-bg-one"  style="background-image: url('{{ asset('front/assets/img/oaahd3.png')}}')">
            <div class="d-table">
                <div class="d-table-cell">
                    <div class="container">
                        <div class="title-item">
                            <h1>{{ trans('front/seo.blog_title') }}</h1>
               
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- Blog -->
        @livewire('blog-list')
        <!-- End Blog -->

I appreciate your help !

0 likes
4 replies
Snapey's avatar

what is your blog-list view called and what folder is it in?

Zoul's avatar
Level 5

Thanks for your support @Snapey !

My blog-list view is located in ```views/livewire/blog-list.blade.php

its using {{ $blogs->links() }}to get the the $blogs from BlogList Component

And the index.balde.php view that is located views/fron/blog.index.blade.php is using @livewire('blog-list') to call the blog-list livewire view but it can't render it

Chingy's avatar
Chingy
Best Answer
Level 6

Hi,

If you are using Livewire 3, your component must be in App/Livewire and not App/Http/Livewire.

Zoul's avatar
Level 5

I moved the Livewire components folder and placed it App/ directory and its working . Thanks both for your help! i really appreciate it

1 like

Please or to participate in this conversation.