Support the ongoing development of Laravel.io →
Blade Cache API
Last updated by @ajax30 1 year ago.
0
moderator

@ajax30 Thanks for providing the log file, that did help in finding the problem.

The first line of your error is:

2023-06-22 15:21:31] local.ERROR: Method Illuminate\View\View::__toString() must not throw an exception, caught Facade\Ignition\Exceptions\ViewException: Undefined variable: theme_directory (View: E:\wamp64\www\larablog\resources\views\themes\calvin\partials\comments-list.blade.php) {"userId":1,"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Method Illuminate\\View\\View::__toString() must not throw an exception, caught Facade\\Ignition\\Exceptions\\ViewException: Undefined variable: theme_directory (View: E:\\wamp64\\www\\larablog\
esources\\views\\themes\\calvin\\partials\\comments-list.blade.php) at E:\\wamp64\\www\\larablog\\app\\Http\\Controllers\\ArticlesController.php:0)

The important part from that is: Undefined variable: theme_directory (View: E:\wamp64\www\larablog\resources\views\themes\calvin\partials\comments-list.blade.php

In your blade file I see:

            @auth
                @include('themes/' . $theme_directory . '/partials/comment-form')
            @endauth

I think you need to change something in this part:

      $content .= view('themes/' . $this->theme_directory . '/partials/comments-list',
                array_merge( $data, [
                  'is_infinitescroll' => $this->is_infinitescroll
                ])
      );

My first idea should be:

      $content .= view('themes/' . $this->theme_directory . '/partials/comments-list',
                array_merge( $data, [
                  'is_infinitescroll' => $this->is_infinitescroll,
                  'theme_directory' => $this->theme_directory,
                ])
      );

But maybe it should be part of data.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Razvan ajax30 Joined 2 Oct 2021

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.