Info Pages

Usage

Working with info pages is very similar to working with articles. 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.
1
use TaffoVelikoff\HotCoffee\InfoPage;
2
...
3
4
// get info page with ID 1
5
$page = InfoPage::find(1);
6
7
// will abort with 401 error if the user does not have the needed role
8
$page->authorizeAccess();
Copied!
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
1
use TaffoVelikoff\HotCoffee\InfoPage;
2
...
3
4
// gets all pages with key (category) "faq"
5
$pages = InfoPage::where('key', 'faq')->get();
Copied!
Last modified 1yr ago
Copy link