<?php

namespace LaraBB\Category\Tasks;

use LaraBB\Category\Models\Category;

/**
 * Class UpdateCategoryTask
 * @package LaraBB\Category\Tasks
 */
class UpdateTask
{
    /**
     * @param Category $category
     * @param array $data
     * @return bool
     */
    public function run(Category $category, array $data = []): bool
    {
        $category->updated_uuid = $data['updated_uuid'];
        $category->title        = $data['title'];
        $category->slug         = $data['slug'];

        return $category->save();
    }
}
