src/Models/Database/Product.php
protected function saveProductCategories($data)
    {
        if (isset($data['category_id']) && count($data['category_id']) > 0) {
            $this->categories()->sync($data['category_id']);
        }
    }
protected function saveProductCategories($data)
    {
        if (isset($data['category_id']) && count($data['category_id']) > 0) {
            $this->categories()->sync($data['category_id']);
        }
    }
protected function saveProductCategories ( $ data ) { if ( isset ( $ data [ 'category_id' ] ) && count ( $ data [ 'category_id' ] ) > 0 ) { $ this -> categories ( ) -> sync ( $ data [ 'category_id' ] ) ; } }
Save Product Categories

@param array $data
@return void
Save Product Categories