private function packageServices()
    {
        if (!empty($this->exportServices)) {
            $services = [];

            foreach ($this->exportServices as $serviceName) {
                if (is_numeric($serviceName)) {
                    /** @type Service $service */
                    $service = Service::find($serviceName);
                } else {
                    /** @type Service $service */
                    $service = Service::whereName($serviceName)->whereDeletable(1)->first();
                }

                if (!empty($service)) {
                    $services[] = [
                        'name'        => $service->name,
                        'label'       => $service->label,
                        'description' => $service->description,
                        'type'        => $service->type,
                        'is_active'   => $service->is_active,
                        'mutable'     => $service->mutable,
                        'deletable'   => $service->deletable,
                        'config'      => $service->config
                    ];
                }
            }

            if (!empty($services) &&
                !$this->zip->addFromString('services.json', json_encode($services, JSON_UNESCAPED_SLASHES))
            ) {
                throw new InternalServerErrorException("Can not include services in package file.");
            }

            return true;
        }

        return false;
    }
private function packageServices()
    {
        if (!empty($this->exportServices)) {
            $services = [];

            foreach ($this->exportServices as $serviceName) {
                if (is_numeric($serviceName)) {
                    /** @type Service $service */
                    $service = Service::find($serviceName);
                } else {
                    /** @type Service $service */
                    $service = Service::whereName($serviceName)->whereDeletable(1)->first();
                }

                if (!empty($service)) {
                    $services[] = [
                        'name'        => $service->name,
                        'label'       => $service->label,
                        'description' => $service->description,
                        'type'        => $service->type,
                        'is_active'   => $service->is_active,
                        'mutable'     => $service->mutable,
                        'deletable'   => $service->deletable,
                        'config'      => $service->config
                    ];
                }
            }

            if (!empty($services) &&
                !$this->zip->addFromString('services.json', json_encode($services, JSON_UNESCAPED_SLASHES))
            ) {
                throw new InternalServerErrorException("Can not include services in package file.");
            }

            return true;
        }

        return false;
    }
private function packageServices ( ) { if ( ! empty ( $ this -> exportServices ) ) { $ services = [ ] ; foreach ( $ this -> exportServices as $ serviceName ) { if ( is_numeric ( $ serviceName ) ) { /** @type Service $service */ $ service = Service :: find ( $ serviceName ) ; } else { /** @type Service $service */ $ service = Service :: whereName ( $ serviceName ) -> whereDeletable ( 1 ) -> first ( ) ; } if ( ! empty ( $ service ) ) { $ services [ ] = [ 'name' => $ service -> name , 'label' => $ service -> label , 'description' => $ service -> description , 'type' => $ service -> type , 'is_active' => $ service -> is_active , 'mutable' => $ service -> mutable , 'deletable' => $ service -> deletable , 'config' => $ service -> config ] ; } } if ( ! empty ( $ services ) && ! $ this -> zip -> addFromString ( 'services.json' , json_encode ( $ services , JSON_UNESCAPED_SLASHES ) ) ) { throw new InternalServerErrorException ( "Can not include services in package file." ) ; } return true ; } return false ; }
Package services for export.

@return bool
@throws \DreamFactory\Core\Exceptions\InternalServerErrorException
Package services for export .