michaelbaril / sqlout

MySQL driver for Laravel Scout
42 stars 6 forks source link

Configuration File not serializable when using Stemmer #7

Closed levizwannah closed 7 months ago

levizwannah commented 7 months ago
...        
'stemmer' => Wamania\Snowball\StemmerFactory::create('english'), // from package wamania/php-stemmer
]

Error

 LogicException 

  Your configuration files are not serializable.

  at vendor\laravel\framework\src\Illuminate\Foundation\Console\ConfigCacheCommand.php:73
     69▕             require $configPath;
     70▕         } catch (Throwable $e) {
     71▕             $this->files->delete($configPath);
     72▕
  ➜  73▕             throw new LogicException('Your configuration files are not serializable.', 0, $e);
     74▕         }
     75▕
     76▕         $this->components->info('Configuration cached successfully.');
     77▕     }

  1   bootstrap\cache\config.php:1257
      Error::("Call to undefined method Wamania\Snowball\Stemmer\English::__set_state()")
  2   vendor\laravel\framework\src\Illuminate\Foundation\Console\ConfigCacheCommand.php:69
michaelbaril commented 7 months ago

Hi @levizwannah , thanks for your feedback.

In order to make your config serializable, you can write this instead:

'stemmer' => Wamania\Snowball\Stemmer\English::class,