我的服务器通过 apache2 在 Linux 中工作,但通过 Windows 机器上的 artisan 服务在开发环境中工作得很好。
错误是未定义变量$washProgram
<div>
Programa {{ $washProgram->name }}
</div>
<?php
namespace App\View\Components;
use Illuminate\View\Component;
class expeditionData extends Component
{
public $op;
public $washProgram;
/**
* Create a new component instance.
*
* @return void
*/
public function __construct($op)
{
$this->op = $op;
$this->washProgram = $op->getSelectedWashProgram();
}
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\View\View|string
*/
public function render()
{
return view('components.expedition-data');
}
}
<x-expedition-data :op="$op" />
我想使用该组件生成一个视图,但它给了我这个错误。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
非常感谢。 Linux 区分大小写。组件的文件名已更改,以便它们全部以大写字母开头: