1
votes

When I run ./vendor/bin/phpunit to check my event & listener, there exist error like this :

Fatal error: Cannot redeclare view() (previously declared in C:\xampp\htdocs\myshop\vendor\laravel\framework\src\Illuminate\Foundation\helpers.php:850) in C:\xampp\htdocs\myshop\app\Http\helpers.php on line 92 PHP Fatal error: Cannot redeclare view() (previously declared in C:\xampp\htdocs\myshop\vendor\laravel\framework\src\Illuminate\Foundation\helpers.php:850) in C:\xampp\htdocs\myshop\app\Http\helpers.php on line 92

How can I solve it?

1
please mention controller code also. - Sagar Arora

1 Answers

5
votes

you can use this code

 if (!function_exists('view')) {
    function view()
    {
        //your code here
    }
    }

or you can use

include_once() or require_once() // your file where you include , so change it and replace it hope it will work