src/Controllers/FolderController.php
public function getAddfolder()
    {
        $folder_name = $this->helper->input('name');

        try {
            if (empty($folder_name)) {
                return $this->helper->error('folder-name');
            } elseif ($this->lfm->setName($folder_name)->exists()) {
                return $this->helper->error('folder-exist');
            } elseif (config('lfm.alphanumeric_directory') && preg_match('/[^\w-]/i', $folder_name)) {
                return $this->helper->error('folder-alnum');
            } else {
                $this->lfm->setName($folder_name)->createFolder();
            }
        } catch (\Exception $e) {
            return $e->getMessage();
        }

        return parent::$success_response;
    }
public function getAddfolder()
    {
        $folder_name = $this->helper->input('name');

        try {
            if (empty($folder_name)) {
                return $this->helper->error('folder-name');
            } elseif ($this->lfm->setName($folder_name)->exists()) {
                return $this->helper->error('folder-exist');
            } elseif (config('lfm.alphanumeric_directory') && preg_match('/[^\w-]/i', $folder_name)) {
                return $this->helper->error('folder-alnum');
            } else {
                $this->lfm->setName($folder_name)->createFolder();
            }
        } catch (\Exception $e) {
            return $e->getMessage();
        }

        return parent::$success_response;
    }
public function getAddfolder ( ) { $ folder_name = $ this -> helper -> input ( 'name' ) ; try { if ( empty ( $ folder_name ) ) { return $ this -> helper -> error ( 'folder-name' ) ; } elseif ( $ this -> lfm -> setName ( $ folder_name ) -> exists ( ) ) { return $ this -> helper -> error ( 'folder-exist' ) ; } elseif ( config ( 'lfm.alphanumeric_directory' ) && preg_match ( '/[^\w-]/i' , $ folder_name ) ) { return $ this -> helper -> error ( 'folder-alnum' ) ; } else { $ this -> lfm -> setName ( $ folder_name ) -> createFolder ( ) ; } } catch ( \ Exception $ e ) { return $ e -> getMessage ( ) ; } return parent :: $ success_response ; }
Add a new folder.

@return mixed
Add a new folder .