public function findByComponentName($name = null)
    {
        return $this->model->with('component', 'priority', 'brand', 'jobs')->whereHas('component', function($q) use($name) {
                    $q->where('active', 1);
                    if (!is_null($name)) {
                        $q->where('name', $name);
                    }
                })->where('brand_id', brand_id());
    }