diff --git a/src/Api.php b/src/Api.php index 28e4aa3..c54b67e 100644 --- a/src/Api.php +++ b/src/Api.php @@ -321,7 +321,7 @@ private function setupResources() //Solution $this->solution = new Solution($this); - $this->folder = new Folder($this); + $this->folders = new Folder($this); //Admin $this->products = new Product($this); diff --git a/src/Resources/Folder.php b/src/Resources/Folder.php index a371c33..02bec39 100644 --- a/src/Resources/Folder.php +++ b/src/Resources/Folder.php @@ -2,7 +2,7 @@ namespace Freshdesk\Resources; -use Freshdesk\Resources\Traits\AllTrait; +use Freshdesk\Resources\Traits\CategoryTrait; use Freshdesk\Resources\Traits\DeleteTrait; use Freshdesk\Resources\Traits\UpdateTrait; use Freshdesk\Resources\Traits\ViewTrait; @@ -17,7 +17,7 @@ class Folder extends AbstractResource { - use AllTrait, ViewTrait, UpdateTrait, DeleteTrait; + use CategoryTrait, ViewTrait, UpdateTrait, DeleteTrait; /** * The resource endpoint @@ -37,7 +37,7 @@ class Folder extends AbstractResource protected $categoryEndpoint = '/solutions/categories'; /** - * Creates the category endpoint (for creating forums) + * Creates the category endpoint (for creating folders) * * @param integer $id * @return string diff --git a/src/Resources/Traits/CategoryTrait.php b/src/Resources/Traits/CategoryTrait.php new file mode 100644 index 0000000..88e843d --- /dev/null +++ b/src/Resources/Traits/CategoryTrait.php @@ -0,0 +1,46 @@ +api()->request('GET', $this->categoryEndpoint($id) . $this->endpoint, null, $query); + } +}