Php 如何解决致命错误:无法重新声明视图()
当我运行Php 如何解决致命错误:无法重新声明视图(),php,laravel,unit-testing,phpunit,laravel-5.3,Php,Laravel,Unit Testing,Phpunit,Laravel 5.3,当我运行/vendor/bin/phpunit检查我的事件和侦听器时,存在如下错误: 致命错误:无法重新声明视图()(以前在中声明 C:\xampp\htdocs\myshop\vendor\laravel\framework\src\illumb\Foundation\helpers.php:850) 在第92行的C:\xampp\htdocs\myshop\app\Http\helpers.php中 错误:无法重新声明视图()(以前在中声明 C:\xampp\htdocs\myshop\ve
/vendor/bin/phpunit
检查我的事件和侦听器时,存在如下错误:
致命错误:无法重新声明视图()(以前在中声明
C:\xampp\htdocs\myshop\vendor\laravel\framework\src\illumb\Foundation\helpers.php:850)
在第92行的C:\xampp\htdocs\myshop\app\Http\helpers.php中
错误:无法重新声明视图()(以前在中声明
C:\xampp\htdocs\myshop\vendor\laravel\framework\src\illumb\Foundation\helpers.php:850)
在第92行的C:\xampp\htdocs\myshop\app\Http\helpers.php中
如何解决它?您可以使用此代码
if (!function_exists('view')) {
function view()
{
//your code here
}
}
或者你可以使用
include_once() or require_once() // your file where you include , so change it and replace it hope it will work
您可以使用此代码
if (!function_exists('view')) {
function view()
{
//your code here
}
}
或者你可以使用
include_once() or require_once() // your file where you include , so change it and replace it hope it will work
请同时提及控制器代码。请同时提及控制器代码。