<?php

namespace LaraBB\Forum\Tasks\User;

use LaraBB\Forum\Models\Forum;

/**
 * Class StoreForumUsersTask
 * @package LaraBB\Forum\Tasks
 */
class StoreTask
{
    /**
     * @param Forum $forum
     * @param array $data
     * @return bool
     */
    public function run(Forum $forum, array $data): bool
    {
        if(empty($data)) return true;

        $forum->users()->attach($data);

        return true;
    }
}
