private function storeOrUpdateCategory($request)
    {
        $cat = $this->category->whereName($request->name)->first();

        if (count($cat) > 0) {
            $category = $cat;
        } else {
            $category = new Category;
            $category->hash = $this->blogify->makeHash('categories', 'hash', true);
        }

        $category->name = $request->name;
        $category->save();

        return $category;
    }
private function storeOrUpdateCategory($request)
    {
        $cat = $this->category->whereName($request->name)->first();

        if (count($cat) > 0) {
            $category = $cat;
        } else {
            $category = new Category;
            $category->hash = $this->blogify->makeHash('categories', 'hash', true);
        }

        $category->name = $request->name;
        $category->save();

        return $category;
    }
private function storeOrUpdateCategory ( $ request ) { $ cat = $ this -> category -> whereName ( $ request -> name ) -> first ( ) ; if ( count ( $ cat ) > 0 ) { $ category = $ cat ; } else { $ category = new Category ; $ category -> hash = $ this -> blogify -> makeHash ( 'categories' , 'hash' , true ) ; } $ category -> name = $ request -> name ; $ category -> save ( ) ; return $ category ; }
Save the given category in the db

@param CategoryRequest $request
@return \jorenvanhocht\Blogify\Models\Category
Save the given category in the db