<?php  

namespace App\Admin\Category;

use App\Models\Category;
use Exception;

class CategoryService {

    public static function createCategory($category, $description){
        try {
            $category = Category::create(
                [
                    'category' => $category,
                    'description' => $description,
                    'type' => 0,
                ]
            );
            return $category;
        } catch (Exception $e) {
            throw new Exception("Error al guardar la categoria {$e->getMessage()}", 1);
            
        }
    }
}