public function update(UserPolicy $user, Category $category)
    {
        if ($user->canDo('blog.category.edit') && $user->isAdmin()) {
            return true;
        }

        return $category->user_id == user_id() && $category->user_type == user_type();
    }
public function update(UserPolicy $user, Category $category)
    {
        if ($user->canDo('blog.category.edit') && $user->isAdmin()) {
            return true;
        }

        return $category->user_id == user_id() && $category->user_type == user_type();
    }
public function update ( UserPolicy $ user , Category $ category ) { if ( $ user -> canDo ( 'blog.category.edit' ) && $ user -> isAdmin ( ) ) { return true ; } return $ category -> user_id == user_id ( ) && $ category -> user_type == user_type ( ) ; }
Determine if the given user can update the given category.

@param UserPolicy $user
@param Category $category

@return bool
Determine if the given user can update the given category .