Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 调用未定义的方法Illumb\Database\Query\Builder::Exception()_Php_Laravel 5.4 - Fatal编程技术网

Php 调用未定义的方法Illumb\Database\Query\Builder::Exception()

Php 调用未定义的方法Illumb\Database\Query\Builder::Exception(),php,laravel-5.4,Php,Laravel 5.4,我想获得一些用户,不包括登录的用户。但是我在运行查询时遇到这个错误,我缺少什么 调用未定义的方法Illumb\Database\Query\Builder::Exception() 尝试使用whereNotIn而不是except(),因为我不认为except()是查询生成器的一种方法,或者已经被弃用 $user = Auth::user()->id; $tests = $this->user->where('referrer', $user) -&

我想获得一些用户,不包括登录的用户。但是我在运行查询时遇到这个错误,我缺少什么

调用未定义的方法Illumb\Database\Query\Builder::Exception()


尝试使用
whereNotIn
而不是
except()
,因为我不认为
except()
是查询生成器的一种方法,或者已经被弃用

$user = Auth::user()->id;

$tests = $this->user->where('referrer', $user)
              ->whereNotIn('id', [$user])
              ->orderBy('id')
              ->take(2)
               ->get();

尝试使用
whereNotIn
而不是
except()
,因为我不认为
except()
是查询生成器的一种方法,或者已经被弃用

$user = Auth::user()->id;

$tests = $this->user->where('referrer', $user)
              ->whereNotIn('id', [$user])
              ->orderBy('id')
              ->take(2)
               ->get();