☕
hotCoffee
  • Introduction
  • ⚙️ GETTING STARTED
    • Installation
    • Resources & Credits
      • Argon Dashboard Free
      • Material Kit Free
      • Font Awesome
      • Laravel Packages
  • 🗂️ Modules
    • Dashboard
    • Menus
    • Articles
    • Info Pages
    • File Manager
    • Users
    • Roles
    • Settings
  • ⚒️ CUSTOMIZATION & LOGIC
    • Routing
    • Configuration
    • Adding Settings
    • Multilanguage
    • Helper Methods
    • Searching Models
    • Exporting
    • Traits
    • Extending Modules
    • Artisan Commands
Powered by GitBook
On this page
  1. 🗂️ Modules

Info Pages

PreviousArticlesNextFile Manager

Last updated 5 years ago

Usage

Working with info pages is very similar to working with . They still need to have a title, content and custom url. They may have attachments just like the articles. However, unlike articles, you have the ability to grant access to a page only for certain user groups.

use TaffoVelikoff\HotCoffee\InfoPage;
...

// get info page with ID 1
$page = InfoPage::find(1);

// will abort with 401 error if the user does not have the needed role
$page->authorizeAccess();

A page can also be assigned to a category. You can add new page categories in config/hotcoffee/infopages.php. You can publish this config file using this command:

php artisan vendor:publish --tag=hotcoffee_config_infopages

use TaffoVelikoff\HotCoffee\InfoPage;
...

// gets all pages with key (category) "faq"
$pages = InfoPage::where('key', 'faq')->get();
articles