PHPackages                             lunacms/forums - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. lunacms/forums

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lunacms/forums
==============

Forums for your laravel app

0.0.2-alpha(3y ago)22GPL-2.0-or-laterPHPPHP ^7.4|^8.0

Since Feb 18Pushed 3y ago1 watchersCompare

[ Source](https://github.com/lunacms/forums)[ Packagist](https://packagist.org/packages/lunacms/forums)[ Docs](https://github.com/lunacms/forums)[ RSS](/packages/lunacms-forums/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (10)Versions (3)Used By (0)

Forums for Laravel Apps
=======================

[](#forums-for-laravel-apps)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5c930b661b5d558aeb220d65f8c7d4172dd4687f7bfc3fcb029449bbe6af410f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c756e61636d732f666f72756d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lunacms/forums)[![Total Downloads](https://camo.githubusercontent.com/8c6196e632ecbbc18a6db8e0afc2b1c3c1361b4b68408a2b464095d7776441dd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c756e61636d732f666f72756d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lunacms/forums)[![GitHub Actions](https://github.com/lunacms/forums/actions/workflows/main.yml/badge.svg)](https://github.com/lunacms/forums/actions/workflows/main.yml/badge.svg)

An `API` first forums package that allows running a single forum or multiple forums within your Laravel app. Supports Laravel 8 and above.

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

[](#installation)

You can install the package via composer:

```
composer require lunacms/forums
```

You

Then run migrate command:

```
php artisan migrate

```

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

[](#configuration)

To customize the package usage, copy the package config to your local config by using the publish command:

```
php artisan vendor:publish --tag=forums-config

```

> You can configure your models, resources and morph map (for polymorphic relationships) there.

Usage
-----

[](#usage)

### Traits

[](#traits)

- `CanCommentTrait` for model to post, update, reply or delete comments.
- `OwnsForumTrait` for model to own a forum.

Add both traits to your `User` model.

> By default the package uses the authenticated request user as owner of forum, posts and comments.

### Running in Single Mode

[](#running-in-single-mode)

Set `mode` option value to `single` in `config/forums.php`.

```
mode='single'
```

Call `runInSingleMode()` in `boot` method of `AppServiceProvider`.

```
Forums::runInSingleMode();
```

### Model Repositories

[](#model-repositories)

The package offers model repositories to enable interaction with the underlying API.

Included repositories are:

- `ForumRepository`: handles basic **forum** `CRUD` operations.
- `PostRepository`: handles basic **post** `CRUD` operations.
- `TagRepository`: handles basic **tag** `CRUD` operations.
- `CommentRepository`: handles basic **comment** `CRUD` operations.

Available methods:

- `all()`: Get all records for a given entity.
- `find($id)`: Find a record by given "id".
- `findWhere($column, $value)`: Find records by given "column" value.
- `findWhereFirst($column, $value)`: Find the first record with given "column" value.
- `paginate($perPage = 10)`: Paginate records for a given entity.
- `create(array $data)`: Create a record for a given entity.
- `update($id, array $data)`: Update a record of a given entity.
- `delete($id)`: Delete a record from an entity.
- `withCriteria(...$criteria)`: Refines a repository's query.

> Repositories can be used if you need to interact more deeply with the API.

### Routes

[](#routes)

By default we have setup routes as the easiest way to use the package.

**Note**: The enclosed `{CUSTOM_PREFIX}` is a prefix which can be changed in the `forums` config `route` prefix.

#### Securing Routes

[](#securing-routes)

You can secure the package routes by setting the relevant middleware in the config file, under routes settings.

There are two options:

- `middleware`: Key used to set the general routing and bindings, default is `web`
- `auth_middleware`: Used for authenticating users who create forums, posts and comments. Default is `auth`.

#### Comment Routes

[](#comment-routes)

They accept an `id` as parameter and `body` in the request data (except `destroy`) route.

- `{CUSTOM_PREFIX}/comments/{comment}`: Handle comment update; `PUT|PATCH`
- `{CUSTOM_PREFIX}/comments/{comment}`: Handle comment destroy; `DELETE`
- `{CUSTOM_PREFIX}/comments/{comment}/replies`: Handle comment reply store; `POST`

#### Forums Routes

[](#forums-routes)

Handles forum functionality when `mode` is `multi`.

For `post` and `put|patch` routes, a `name` is required, and optional `tags` array.

When displaying, updating, or deleting a `slug` is passed as route param.

- `{CUSTOM_PREFIX}/forums`: Handles forums listing; `GET|HEAD`
- `{CUSTOM_PREFIX}/forums`: Handles forum storage; `POST`
- `{CUSTOM_PREFIX}/forums/{slug}`: Handles showing single forum data; `GET|HEAD`
- `{CUSTOM_PREFIX}/forums/{slug}`: Handles forum update; `PUT|PATCH`
- `{CUSTOM_PREFIX}/forums/{slug}`: Handles forum destroy; `DELETE`

#### Posts Routes (in multi mode)

[](#posts-routes-in-multi-mode)

Pass **forum** `slug` as route param for all routes below: ie replace `forums:slug`.

An additional `slug` required for the single post display route, use `$post->slug`

- `{CUSTOM_PREFIX}/forums/{forum:slug}/posts`: Handles a forums posts listing; `GET|HEAD`
- `{CUSTOM_PREFIX}/forums/{forum:slug}/posts`: Handles a forums post storage; `POST`
- `{CUSTOM_PREFIX}/forums/{forum:slug}/posts/{slug}` : Handles showing of a single post in a forum; `GET|HEAD`

#### Posts Route (in single mode)

[](#posts-route-in-single-mode)

Post `slug` required for a single post display route.

- `{CUSTOM_PREFIX}/posts`: Handles a posts listing; `GET|HEAD`
- `{CUSTOM_PREFIX}/posts`: Handles a post storage; `POST`
- `{CUSTOM_PREFIX}/posts/{slug}` : Handles a showing of a forums post; `GET|HEAD`

#### Posts Routes (shared in both modes)

[](#posts-routes-shared-in-both-modes)

Post `slug` as route param.

- `{CUSTOM_PREFIX}/posts/{slug}`: Handle post update; `PUT|PATCH`
- `{CUSTOM_PREFIX}/posts/{slug}`: Handle post delete; `DELETE`

#### Post Comment Routes (shared in both modes)

[](#post-comment-routes-shared-in-both-modes)

Post `slug` as route param; `body` passed as request data for `POST` route.

- `{CUSTOM_PREFIX}/posts/{slug}/comments`: Handle listing a post's comments; `GET|HEAD`
- `{CUSTOM_PREFIX}/posts/{slug}/comments`: Handle creating a post's comment; `POST`

#### Tags

[](#tags)

Use `slug` as route params for all routes except `index` and `store`.

Pass `name` as request data for `POST` and `PATCH` routes.

- `{CUSTOM_PREFIX}/tags`: Handles tags listing; `GET|HEAD`
- `{CUSTOM_PREFIX}/tags`: Handles tags store; `POST`
- `{CUSTOM_PREFIX}/tags/{tag}`: Handles single tag display; `GET|HEAD`
- `{CUSTOM_PREFIX}/tags/{tag}`: Handles tag update; `PUT|PATCH`
- `{CUSTOM_PREFIX}/tags/{tag}`: Handles tag destroy; `DELETE`

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

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

[](#contributing)

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

### Security

[](#security)

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

Credits
-------

[](#credits)

- [Cuthbert Mirambo](https://github.com/miracuthbert)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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 ~7 days

Total

2

Last Release

1224d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13046285?v=4)[Cuthbert Mirambo](/maintainers/miracuthbert)[@miracuthbert](https://github.com/miracuthbert)

---

Top Contributors

[![miracuthbert](https://avatars.githubusercontent.com/u/13046285?v=4)](https://github.com/miracuthbert "miracuthbert (2 commits)")

---

Tags

lunacmsforums

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lunacms-forums/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M130](/packages/laravel-pulse)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M130](/packages/roots-acorn)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k90.5k1](/packages/mike-bronner-laravel-model-caching)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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