rmunate / SpellNumber

🔢 Convert Numbers to Words Effortlessly in Laravel! 🌟🔠 Say goodbye to complex coding! This ingenious library, seamlessly integrated with the native PHP INTL extension, empowers you to effortlessly transform numbers into words within your Laravel projects. 🚀📊
https://rmunate.github.io/SpellNumber/
287 stars 43 forks source link

Cannot cache configs due to callback present in config file #27

Closed percymamedy closed 2 months ago

percymamedy commented 9 months ago
   /*
    |--------------------------------------------------------------------------
    | Encountered a specific adjustment in the number to words output?.
    |--------------------------------------------------------------------------
    |
    | Here, you have the option to adjust whatever you need, the best part!
    | This adjustment will apply to all your number to words outputs.
    |
    */

    'callback_output' => function ($data) {
        // Your logic here...

        return $data->getWords();
    },

This block of code in the config files prevents caching config file. See output below:

INFO  Caching the framework bootstrap files.                              

    config ........................................................... 36ms F  
  AIL                                                                          

     LogicException                                                            

    Your configuration files are not serializable. 
rmunate commented 9 months ago

Thank you very much for the report, we are seeing if we can use the Serialize interface and if it does not work it will be necessary to remove the closure and include a method that allows you to do similar things.

rmunate commented 9 months ago

We are almost ready on Tuesday we will have the new version with all the adjustments thank you for the wait