Elasticsearch报Call to undefined xx makeAllSearchable()错误
使用命令php artisan scout:import “App\Province”
> BadMethodCallException
Call to undefined method Modules\Basis\Entities\Province::makeAllSearchable()
at vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:71
67▕ * @throws \BadMethodCallException
68▕ */
69▕ protected static function throwBadMethodCallException($method)
70▕ {
➜ 71▕ throw new BadMethodCallException(sprintf(
72▕ 'Call to undefined method %s::%s()', static::class, $method
73▕ ));
74▕ }
75▕ }
• Bad Method Call: Did you mean Modules\Basis\Entities\Province::searchableAs() ?
+17 vendor frames
18 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
macdeimac:rbac mac$ php artisan scout:import "Modules\Basis\Entities\Province"
BadMethodCallException
Call to undefined method Modules\Basis\Entities\Province::makeAllSearchable()
at vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:71
67▕ * @throws \BadMethodCallException
68▕ */
69▕ protected static function throwBadMethodCallException($method)
70▕ {
➜ 71▕ throw new BadMethodCallException(sprintf(
72▕ 'Call to undefined method %s::%s()', static::class, $method
73▕ ));
74▕ }
75▕ }
> • Bad Method Call: Did you mean Modules\Basis\Entities\Province::searchableAs() ?
报这个错误,主要是Searchable 类 未使用 use Searchable类就解决问题
use Searchable;
本作品采用《CC 协议》,转载必须注明作者和本文链接
推荐文章: