PHPackages                             javaabu/cms - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. javaabu/cms

ActiveLibrary

javaabu/cms
===========

A flexible CMS package for Laravel with support for custom post types and categories

v1.1.0(9mo ago)014[1 issues](https://github.com/Javaabu/cms/issues)MITPHPPHP ^8.3CI failing

Since May 26Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/Javaabu/cms)[ Packagist](https://packagist.org/packages/javaabu/cms)[ Docs](https://github.com/Javaabu/cms)[ RSS](/packages/javaabu-cms/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (12)Versions (4)Used By (0)

Javaabu CMS
===========

[](#javaabu-cms)

A flexible and extensible Content Management System package for Laravel applications. Built with support for custom post types, hierarchical categories, and rich content editing with Editor.js.

Features
--------

[](#features)

- 🎯 **Custom Post Types**: Define unlimited custom post types with configurable features
- 📁 **Hierarchical Categories**: Nested category support using Nestedset
- ✍️ **Rich Content Editor**: Integrated Editor.js support for modern content editing
- 🔐 **Permission System**: Built-in permission management for CMS operations
- 🌐 **Multi-language Ready**: Translation support for content
- 📱 **Responsive Admin**: Modern admin interface
- 🔌 **Extensible**: Easy to extend with custom controllers, views, and policies
- 🚀 **Easy Setup**: Artisan command for quick installation

Requirements
------------

[](#requirements)

- PHP ^8.2
- Laravel ^11.0 or ^12.0
- MySQL/PostgreSQL database

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require javaabu/cms
```

Run the setup command:

```
php artisan cms:setup
```

This will:

- Publish the configuration file
- Publish and run migrations
- Optionally install default post types and categories
- Seed CMS permissions

### Quick Start with Defaults

[](#quick-start-with-defaults)

To get started quickly with pre-configured post types and categories:

```
php artisan cms:setup --with-defaults
```

This installs 10 ready-to-use post types (News, Blog, Downloads, Announcements, Publications, Jobs, Galleries, Tenders, Reports, Pages) with their category types and sample categories.

You can customize these defaults in `config/cms.php` before running setup.

Configuration
-------------

[](#configuration)

After installation, configure your post types in `config/cms.php`:

```
'post_types' => [
    'news' => [
        'label' => 'News',
        'singular_label' => 'News Article',
        'features' => ['categories', 'featured_image', 'excerpt'],
        'category_types' => ['news-categories'],
    ],
    'blog' => [
        'label' => 'Blog Posts',
        'singular_label' => 'Blog Post',
        'features' => ['categories', 'featured_image', 'excerpt', 'video-link'],
        'category_types' => ['blog-categories'],
    ],
],

'category_types' => [
    'news-categories' => [
        'label' => 'News Categories',
        'singular_label' => 'News Category',
        'hierarchical' => true,
    ],
],
```

Register Routes
---------------

[](#register-routes)

Add CMS routes to your `routes/web.php`:

```
use Javaabu\Cms\Support\Routes;

// Admin routes
Routes::admin(
    prefix: 'admin',
    middleware: ['web', 'auth', 'verified']
);

// Public routes
Routes::web();

// Or register custom post type routes
Routes::customPostType(
    postTypeSlug: 'news',
    prefix: 'news',
    middleware: ['web']
);
```

Usage
-----

[](#usage)

### Creating Post Types

[](#creating-post-types)

Post types can be created via:

1. **Database Seeder**:

```
use Javaabu\Cms\Models\PostType;

PostType::create([
    'name' => 'News',
    'singular_name' => 'News Article',
    'slug' => 'news',
    'icon' => 'newspaper',
    'features' => [
        'categories' => true,
        'featured_image' => true,
        'excerpt' => true,
    ],
]);
```

2. **Admin Panel**: Navigate to `/admin/post-types` after setup

### Creating Posts

[](#creating-posts)

```
use Javaabu\Cms\Models\Post;
use Javaabu\Cms\Enums\PostStatus;

$post = Post::create([
    'type' => 'news',
    'title' => 'Breaking News',
    'slug' => 'breaking-news',
    'content' => 'Content here...',
    'excerpt' => 'Short description',
    'status' => PostStatus::PUBLISHED->value,
    'published_at' => now(),
]);

// Attach categories
$post->categories()->attach($categoryIds);
```

### Querying Posts

[](#querying-posts)

```
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();
```

### Working with Categories

[](#working-with-categories)

```
use Javaabu\Cms\Models\Category;

// Get categories for select dropdown
$categories = Category::categoryList($typeId);

// Get nested categories
$categories = Category::categoryType($typeId)
    ->defaultOrder()
    ->get()
    ->toTree();
```

Available Post Type Features
----------------------------

[](#available-post-type-features)

- `categories` - Category support
- `featured_image` - Featured image
- `excerpt` - Post excerpt
- `documents` - Document attachments
- `image_gallery` - Image gallery
- `video_link` - Video embed URL
- `document_number` - Document reference number
- `expireable` - Expiry date
- `format` - Post format (standard, video, gallery, etc.)
- `page_style` - Custom page styling
- `ref_no` - Reference number
- `gazette_link` - Gazette document link

Permissions
-----------

[](#permissions)

The package dynamically creates permissions for each Post Type and Category Type you create. Permissions are based on the slug of the type.

### Post Type Permissions

[](#post-type-permissions)

For each Post Type (e.g., 'news'), the following permissions are created:

- `edit_{slug}` - Edit own posts (e.g., `edit_news`)
- `edit_others_{slug}` - Edit all posts (e.g., `edit_others_news`)
- `delete_{slug}` - Delete own posts
- `delete_others_{slug}` - Delete all posts
- `view_{slug}` - View own posts
- `view_others_{slug}` - View all posts
- `force_delete_{slug}` - Force delete own posts
- `force_delete_others_{slug}` - Force delete all posts
- `publish_{slug}` - Publish own posts
- `publish_others_{slug}` - Publish all posts
- `import_{slug}` - Import posts

### Category Type Permissions

[](#category-type-permissions)

For each Category Type (e.g., 'news-categories'), the following permissions are created:

- `edit_{slug}` - Edit categories (e.g., `edit_news_categories`)
- `delete_{slug}` - Delete categories
- `view_{slug}` - View categories
- `import_{slug}` - Import categories

### Seeding Permissions

[](#seeding-permissions)

Seed them using:

```
use Javaabu\Cms\seeders\CmsPermissionsSeeder;

CmsPermissionsSeeder::seedPermissions();
```

Call this after creating your Post Types and Category Types to generate the appropriate permissions.

Frontend Integration
--------------------

[](#frontend-integration)

The package provides models and data - implement your own views:

```
{{-- resources/views/posts/index.blade.php --}}
@foreach($posts as $post)

        {{ $post->title }}
        {{ $post->excerpt }}

            Read More

@endforeach
```

Editor.js Integration
---------------------

[](#editorjs-integration)

Install the required npm packages:

```
npm install --save @editorjs/editorjs @editorjs/header @editorjs/list @editorjs/image @editorjs/quote @editorjs/table @editorjs/delimiter @editorjs/embed @editorjs/link @editorjs/raw @editorjs/simple-image @calumk/editorjs-columns
```

Or copy dependencies from `package.json` in the package root.

### Frontend Configuration

[](#frontend-configuration)

You must also configure the `window.Laravel` object in your admin layout. See the [Installation and Setup Guide](docs/installation-and-setup.md#laravel-object-configuration) for details.

Testing
-------

[](#testing)

```
composer test
```

Documentation
-------------

[](#documentation)

For detailed documentation, see the [docs](docs/) directory:

- [Installation and Setup](docs/installation-and-setup.md)
- [Requirements](docs/requirements.md)
- [Basic Usage](docs/basic-usage/)

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security-related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Credits
-------

[](#credits)

- [Javaabu](https://javaabu.com)
- [All Contributors](../../contributors)

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance74

Regular maintenance activity

Popularity6

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 67.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~29 days

Total

3

Last Release

299d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6671720?v=4)[Arushad Ahmed](/maintainers/dash8x)[@dash8x](https://github.com/dash8x)

![](https://avatars.githubusercontent.com/u/31658513?v=4)[Javaabu](/maintainers/javaabu)[@Javaabu](https://github.com/Javaabu)

![](https://www.gravatar.com/avatar/221f1bea0a3ea66d158df62a82d17beac57f0aacf62c38fae3dcb0474c734016?d=identicon)[athphane](/maintainers/athphane)

---

Top Contributors

[![WovenCoast](https://avatars.githubusercontent.com/u/44475239?v=4)](https://github.com/WovenCoast "WovenCoast (33 commits)")[![Farish278](https://avatars.githubusercontent.com/u/30434207?v=4)](https://github.com/Farish278 "Farish278 (14 commits)")[![athphane](https://avatars.githubusercontent.com/u/13810742?v=4)](https://github.com/athphane "athphane (2 commits)")

---

Tags

laravelcmsjavaabu

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/javaabu-cms/health.svg)

```
[![Health](https://phpackages.com/badges/javaabu-cms/health.svg)](https://phpackages.com/packages/javaabu-cms)
```

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[unopim/unopim

UnoPim Laravel PIM

9.4k1.8k](/packages/unopim-unopim)[riclep/laravel-storyblok

A Laravel wrapper around the Storyblok API to provide a familiar experience for Laravel devs

6272.7k4](/packages/riclep-laravel-storyblok)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)[a2insights/filament-saas

Filament Saas for A2Insights

161.1k](/packages/a2insights-filament-saas)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
