1

我在 app/View/Components/RemoveBook 中有一个组件 RemoveBook,在 resources/views/components/sections/parts/remove-book.blade.php 中有一个刀片组件。

在本地主机上一切正常,但在服务器上 - Cpanel - 不渲染

组件代码

public $route;
public $bookid;
/**
 * Create a new component instance.
 *
 * @return void
 */
public function __construct($route, $bookid)
{
    $this->route = $route;
    $this->bookid = $bookid;
}

/**
 * Get the view / contents that represent the component.
 *
 * @return \Illuminate\Contracts\View\View|\Closure|string
 */
public function render()
{
    $this->route = Request::is('myBook*') ? 'myBook.destroy' : 'wishList.destroy';
    return view('components.sections.parts.remove-book');
}

在视野中

{!! Form::open(['route' => [$route, $bookid], 'method' => 'delete']) !!}
<div class="absolute top-0 right-0">
    <button class="w-35-px h-35-px bg-brand-black text-white border hover:opacity-100">
        X
    </button>
</div>
{!! Form::close() !!}

并且超过 5 个组件未在服务器上呈现 - 所有组件 - 但在 localhost 上一切正常

在此处输入图像描述

在此处输入图像描述

4

1 回答 1

0

尝试

composer install

然后

composer update

然后

composer dump-autoload

然后

php artisan config:cache
于 2021-09-30T23:46:36.380 回答