laravel 6.x 全文搜索Scout生成宏命令出错
根据文档配置count宏命令
出现以下错误
以下是我的代码
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Laravel\Scout\Builder;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Builder::macro('count', function () {
return $this->engine->getTotalCount(
$this->engine()->search($this)
);
});
}
}
请问这种怎么解决呀?
engine,里面的两个不是都用方法?第一个为啥不用方法。