public function enableOrDisable($name, $status)
    {
        $file = route()->com.$name.'/component.json';
        if (file_exists($file)) {
            $fileHandling = new FileHandling();
            $c = $fileHandling->open($file, 'readOnly')->read();
            $config = json_decode($c, true);
            $config['status'] = $status;
            $config = json_encode($config, JSON_PRETTY_PRINT);
            $fileHandling->open($file, 'writeOnly')->write($config);
            $fileHandling->close();

            return true;
        }

        return false;
    }
public function enableOrDisable($name, $status)
    {
        $file = route()->com.$name.'/component.json';
        if (file_exists($file)) {
            $fileHandling = new FileHandling();
            $c = $fileHandling->open($file, 'readOnly')->read();
            $config = json_decode($c, true);
            $config['status'] = $status;
            $config = json_encode($config, JSON_PRETTY_PRINT);
            $fileHandling->open($file, 'writeOnly')->write($config);
            $fileHandling->close();

            return true;
        }

        return false;
    }
public function enableOrDisable ( $ name , $ status ) { $ file = route ( ) -> com . $ name . '/component.json' ; if ( file_exists ( $ file ) ) { $ fileHandling = new FileHandling ( ) ; $ c = $ fileHandling -> open ( $ file , 'readOnly' ) -> read ( ) ; $ config = json_decode ( $ c , true ) ; $ config [ 'status' ] = $ status ; $ config = json_encode ( $ config , JSON_PRETTY_PRINT ) ; $ fileHandling -> open ( $ file , 'writeOnly' ) -> write ( $ config ) ; $ fileHandling -> close ( ) ; return true ; } return false ; }
Activate or Disable component.

@param (string) $name   Name of component.
@param (bool)   $status Valid status.

@since 3.0.0

@return bool
Activate or Disable component .