Search code examples
laravellaravel-8laravel-artisan

Laravel 8 configurations not serialized - permanent soultion


When I try to run the following command in laravel 8,

php artisan config:cache

I'm getting error:

  LogicException 

  Your configuration files are not serializable.

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

  1   C:\xampp\htdocs\laravel8\bootstrap\cache\config.php:1083
      Error::("Call to undefined method Illuminate\Validation\Rules\In::__set_state()")

  2   C:\xampp\htdocs\laravel8\vendor\laravel\framework\src\Illuminate\Foundation\Console\ConfigCacheCommand.php:67
      require()

On question Call to undefined method Illuminate\Validation\Rules\In::__set_state(), Someone has provided a solution by editing the vendor files but it's not a confirmed fix as it will get wiped out once the composer install command reran.


Solution

  • An in-use package was generating a config file which was calling the function Rule::in(['true', 'false']). By Removing the config file and modifying the condition, it is working now.