Blog User Guide Documentation API Login Register

Documentation > Reference

Category Helpers

Last updated February 16, 2024

Available Methods

Method Listing

category_group_exists()

The category_group_exists method will return a boolean value based on if the given category group exists or not.

if (category_group_exists('blog')) {
    // The category group "blog" exists
}

category_groups()

The category_groups method returns an instance of the category group model.

foreach (category_groups()->all() as $group) {
    //
}

categories()

The categories method returns an instance of the category model for the given group.

// Fetch all categories under the "blog" category group
foreach (categories('blog')->all() as $category) {
    //
}