vendor categories fx8
This commit is contained in:
parent
31ad695706
commit
e77e509b14
|
|
@ -54,4 +54,20 @@ class CategoryRepository extends WCategoryRepository
|
||||||
->groupBy('category_id')
|
->groupBy('category_id')
|
||||||
->get();
|
->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function create(array $data){
|
||||||
|
$category = parent::create($data);
|
||||||
|
|
||||||
|
if (isset($data['vendors'])) {
|
||||||
|
$category->vendors()->sync($data['vendors']);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update(array $data, $id, $attribute = 'id'){
|
||||||
|
$category = parent::update($data,$id,$attribute );
|
||||||
|
if (isset($data['vendors'])) {
|
||||||
|
$category->vendors()->sync($data['vendors']);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue