使用命令 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;  
                    
 
                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                        