Devise\Media\Categories\Manager::storeNewCategory PHP Method

storeNewCategory() public method

Stores the category in the filesystem
public storeNewCategory ( $input ) : boolean
$input
return boolean
    public function storeNewCategory($input)
    {
        if (isset($input['name']) && isset($input['category'])) {
            $localPath = $this->CategoryPaths->fromDot($input['category']);
            $serverPath = $this->CategoryPaths->serverPath($localPath);
            if ($this->Filesystem->isDirectory($serverPath . $input['name'])) {
                throw new CategoryAlreadyExistsException('This category already exists, cannot create ' . $input['name']);
            }
            return $this->Filesystem->makeDirectory($serverPath . $input['name'], 0775);
        }
        return false;
    }