Fenos\Notifynder\Categories\CategoryRepository::delete PHP Method

delete() public method

Delete category by ID.
public delete ( $categoryId ) : mixed
$categoryId
return mixed
    public function delete($categoryId)
    {
        return $this->categoryModel->where('id', $categoryId)->delete();
    }

Usage Example

 /** @test */
 function it_delete_a_category_by_id()
 {
     $categoryToDelete = $this->createCategory();
     $this->categoryRepo->delete($categoryToDelete->id);
     $tryToFindThatCategory = $this->categoryRepo->find($categoryToDelete->id);
     $this->assertEquals($tryToFindThatCategory, null);
 }