src/Models/Repository/CategoryFilterRepository.php
public function saveFilter($categoryId, $filterId, $type)
    {
        $filterModel = CategoryFilter::whereCategoryId($categoryId)
                                        ->whereFilterId($filterId)
                                        ->whereType('PROPERTY')->first();
        if (null === $filterModel) {
            CategoryFilter::create([
                'category_id' => $categoryId,
                'filter_id' => $filterId,
                'type' => 'PROPERTY'
            ]);
        }
    }
public function saveFilter($categoryId, $filterId, $type)
    {
        $filterModel = CategoryFilter::whereCategoryId($categoryId)
                                        ->whereFilterId($filterId)
                                        ->whereType('PROPERTY')->first();
        if (null === $filterModel) {
            CategoryFilter::create([
                'category_id' => $categoryId,
                'filter_id' => $filterId,
                'type' => 'PROPERTY'
            ]);
        }
    }
public function saveFilter ( $ categoryId , $ filterId , $ type ) { $ filterModel = CategoryFilter :: whereCategoryId ( $ categoryId ) -> whereFilterId ( $ filterId ) -> whereType ( 'PROPERTY' ) -> first ( ) ; if ( null === $ filterModel ) { CategoryFilter :: create ( [ 'category_id' => $ categoryId , 'filter_id' => $ filterId , 'type' => 'PROPERTY' ] ) ; } }
Save Categoy Filter
@param integer $categoryId
@param integer $filterId
@param string $type
@return \AvoRed\Framework\Models\Database\CategoryFilter
Save Categoy Filter