我在 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 上一切正常

