PHPackages                             ousamox/messages-manager - 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. ousamox/messages-manager

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

ousamox/messages-manager
========================

The package provides an easy way to implementing a messages manager into your laravel project

00PHP

Since Jan 13Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ousamox/messages-manager)[ Packagist](https://packagist.org/packages/ousamox/messages-manager)[ RSS](/packages/ousamox-messages-manager/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

MessagesManager
---------------

[](#messagesmanager)

> This package support only Laravel 5.x versions

### Installation

[](#installation)

Add MessagesManager package to your composer.json file to require it :

```
    require : {
        "laravel/framework": xxxx,
        ...
        "ousamox/messages-manager": "master"
    }

```

Update Composer :

```
$ composer update

```

The next required step is to add the service provider to `config/app.php` :

```
    'providers' => array(
    	...
    	'Ousamox\MessagesManager\Providers\MessagesManagerProvider'
    )

```

Alias the PushNotification facade by adding it to the aliases array in the `config/app.php` file :

```
    'aliases' => array(
        ...
        'OMessage' => 'Ousamox\MessagesManager\Facades\OMessage'
    )

```

### Configuration

[](#configuration)

#### Publish Files

[](#publish-files)

Publish OMM config and migration files in your application with :

```
$ php artisan vendor:publish --tag=omm

```

This will generate a config file in `config/omm.php` like this :

```
return [
    'models' => [
        'channel' => [
            'table_name' => 'OMM_CHANNELS',
            'class' => \Ousamox\MessagesManager\Models\Channel::class,
        ],
        'device' => [
            'table_name' => 'OMM_DEVICES',
            'class' => \Ousamox\MessagesManager\Models\Device::class,
        ],
        'message' => [
            'table_name' => 'OMM_MESSAGES',
            'class' => \Ousamox\MessagesManager\Models\Message::class,
        ],
        'message_seen' => [
            'table_name' => 'OMM_MESSAGE_SEENS',
            'class' => \Ousamox\MessagesManager\Models\MessageSeen::class,
        ],
        'message_file' => [
            'table_name' => 'OMM_MESSAGE_FILES',
            'class' => \Ousamox\MessagesManager\Models\MessageFile::class,
        ],
        'session' => [
            'table_name' => 'OMM_SESSIONS',
            'class' => \Ousamox\MessagesManager\Models\Session::class,
        ],
        'user' => [
            'table_name' => 'OMM_USERS',
            'class' => \Ousamox\MessagesManager\Models\User::class,
        ],
    ],
    'channels_duplication' => env('OMM_CHANNELS_DUPLICATION',false),
];
```

This will generate also a migration file in `database/migrations` contains all tables that we must have in our database.

#### Configure files

[](#configure-files)

We can customise the name of our tables by editing the `models..table_name` value in `config/omm.php`

We can alse customise the main model class for each entity by editing the `models..class` value in `config/omm.php` :

**Example :**

`config/omm.php` :

```
return [
    'models' => [
        'channel' => [
            'table_name' => 'app_channels',
            'class' => App\Models\Channel::class,
        ],
        ...
```

`app/models/Channel.php` :

```
namespace App\Models;

use Ousamox\MessagesManager\Models\Channel as BaseChannel;

class Channel extends BaseChannel
{
    // Add or Override the main behavior of this class without touching its defined properties or attributes
    ...
}
```

The last step is generating tables by running this command :

```
$ php artisan migrate

```

Congratulations, you have successfully installed MessagesManager in your project !

### Usage

[](#usage)

> 1- Authentification is required when using these methods

> 2- Pagination must be available on the next release

#### Get All Channels (conversations)

[](#get-all-channels-conversations)

To get the list of channels :

```
$channels = \OMessage::getChannels();
```

#### Get Messages by channel (conversation)

[](#get-messages-by-channel-conversation)

To get the list of channels :

```
// $value must be an integer (channel ID) or a Channel Object
$messages = \OMessage::getMessagesByChannel($value);
```

#### Send Message

[](#send-message)

**Send First Message in new channel**

```
$messages = \OMessage::sendMessageNewChannel($messageData: array, $channelData: array $toUsers: array, $files = []);
```

***Parameters :***

ParameterDescription`messageData`\[Required\] data array should respect the following structure :```
[
   'content' => 'Hello World', // REQUIRED
   'sent_from_lat' => 3.993843, // OPTIONAL (MAPS Latituude)
   'sent_from_long' => 23.222843, // OPTIONAL (MAPS Longitude)
   ... // Other attributes added in entity : message
]

```

ParameterDescription`channelData`\[Required\] data array should respect the following structure :```
[
   'subject' => 'New Channel', // OPTIONAL
   .. // Other attributes added in entity : channel
]

```

ParameterDescription`toUsers`\[Required\] array of users ID that must receive message (one or many)`files`\[Optional\] array of files to join (one or many)**Send Message in existing channel**

```
$messages = \OMessage::sendMessageExistingChannel($messageData: array, $channel: ChannelModel|int, $files = []);
```

***Parameters :***

ParameterDescription`messageData`\[Required\] data array should respect the following structure :```
[
   'content' => 'Hello World', // REQUIRED
   'sent_from_lat' => 3.993843, // OPTIONAL (MAPS Latituude)
   'sent_from_long' => 23.222843, // OPTIONAL (MAPS Longitude)
   ... // Other attributes added in entity : message
]

```

ParameterDescription`channel`\[Required\] Channel object or channel ID`files`\[Optional\] array of files to join (one or many)**Add users to an existing channel**

> Only channel creator could attach users to it

```
$messages = \OMessage::addUsersToChannel($channel: ChannelModel|int, $users: array);
```

***Parameters :***

ParameterDescription`channel`\[Required\] Channel object or channel ID`users`\[Required\] array of users ID that must attach this channel

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ced3545ff1eb759c0195571d8916cdd7a0caf253d315802bad386daf2402e5c?d=identicon)[ousamox](/maintainers/ousamox)

---

Top Contributors

[![ousamox](https://avatars.githubusercontent.com/u/17595466?v=4)](https://github.com/ousamox "ousamox (3 commits)")

### Embed Badge

![Health badge](/badges/ousamox-messages-manager/health.svg)

```
[![Health](https://phpackages.com/badges/ousamox-messages-manager/health.svg)](https://phpackages.com/packages/ousamox-messages-manager)
```

###  Alternatives

[benpickles/peity

Peity (sounds like deity) is a jQuery plugin that converts an element's content into a mini `&lt;svg&gt;` pie, donut, line or bar chart.

4.2k2.8k](/packages/benpickles-peity)[2amigos/yii2-grid-view-library

GridView Widget Extensions for Yii2.

56147.2k12](/packages/2amigos-yii2-grid-view-library)[zhuravljov/yii2-datetime-widgets

Datetime widgets for Yii2.

21118.6k3](/packages/zhuravljov-yii2-datetime-widgets)[smajti1/laravel-wizard

Wizard component for laravel.

409.2k](/packages/smajti1-laravel-wizard)[tivie/command

An utility library that harmonizes OS differences and executes external programs in a safer way

1455.3k1](/packages/tivie-command)[jfcherng-roundcube/show-folder-size

A Roundcube plugin which shows folder size.

2515.2k](/packages/jfcherng-roundcube-show-folder-size)

PHPackages © 2026

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