1. Go to this page and download the library: Download javaabu/cms library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Javaabu\Cms\Models\Post;
// Get published posts of a type
$posts = Post::postType('news')
->published()
->ordered()
->paginate(15);
// Search posts
$posts = Post::postType('news')
->search('keyword')
->published()
->get();
// Get posts by year
$posts = Post::postType('news')
->publishedByYear(2024)
->get();
use Javaabu\Cms\Models\Category;
// Get categories for select dropdown
$categories = Category::categoryList($typeId);
// Get nested categories
$categories = Category::categoryType($typeId)
->defaultOrder()
->get()
->toTree();
use Javaabu\Cms\seeders\CmsPermissionsSeeder;
CmsPermissionsSeeder::seedPermissions();