src/Console/HCGenerateFormsCommand.php
public function handle(): void
    {
        $this->comment('Scanning form items..');

        $filePaths = $this->helper->getConfigFilesSorted();

        $formHolder = [];

        foreach ($filePaths as $filePath) {

            $file = json_decode(file_get_contents($filePath), true);

            if (isset($file['formData'])) {
                $formHolder = array_merge($formHolder, $file['formData']);
            }
        }

        cache()->forget('hc-forms');
        cache()->put('hc-forms', $formHolder, now()->addMonth());

        $this->info('registered forms: ' . count($formHolder));
        $this->comment('-');
    }
public function handle(): void
    {
        $this->comment('Scanning form items..');

        $filePaths = $this->helper->getConfigFilesSorted();

        $formHolder = [];

        foreach ($filePaths as $filePath) {

            $file = json_decode(file_get_contents($filePath), true);

            if (isset($file['formData'])) {
                $formHolder = array_merge($formHolder, $file['formData']);
            }
        }

        cache()->forget('hc-forms');
        cache()->put('hc-forms', $formHolder, now()->addMonth());

        $this->info('registered forms: ' . count($formHolder));
        $this->comment('-');
    }
public function handle ( ) : void { $ this -> comment ( 'Scanning form items..' ) ; $ filePaths = $ this -> helper -> getConfigFilesSorted ( ) ; $ formHolder = [ ] ; foreach ( $ filePaths as $ filePath ) { $ file = json_decode ( file_get_contents ( $ filePath ) , true ) ; if ( isset ( $ file [ 'formData' ] ) ) { $ formHolder = array_merge ( $ formHolder , $ file [ 'formData' ] ) ; } } cache ( ) -> forget ( 'hc-forms' ) ; cache ( ) -> put ( 'hc-forms' , $ formHolder , now ( ) -> addMonth ( ) ) ; $ this -> info ( 'registered forms: ' . count ( $ formHolder ) ) ; $ this -> comment ( '-' ) ; }
Get all honeycomb form config files and add it to cache
Get all honeycomb form config files and add it to cache