PHPackages                             pichkrement/messenger - 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. [Framework](/categories/framework)
4. /
5. pichkrement/messenger

AbandonedArchivedLibrary[Framework](/categories/framework)

pichkrement/messenger
=====================

Simple L4 Scaffold/Framework for a (Group) Messaging System

571.5k11[8 issues](https://github.com/inkrement/l4-messenger/issues)[1 PRs](https://github.com/inkrement/l4-messenger/pulls)PHP

Since Mar 4Pushed 9y ago11 watchersCompare

[ Source](https://github.com/inkrement/l4-messenger)[ Packagist](https://packagist.org/packages/pichkrement/messenger)[ RSS](/packages/pichkrement-messenger/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

> please use  instead. this package is deprecated.

\#L4 Messenger

Basic Messaging System for Laravel4

Introduction
------------

[](#introduction)

The main purpose of this package is providing an suited Foundation for extended communication platforms, based on laravel 4 (or compatible frameworks).

\##Overview You have many users and they want to chat? Couldn't be simplier! We extended the standard Laravel User-Model to satisfy the requirements.

- Users have many conversations
- A conversation belongs to many users
- A message belongs to a single conversation
- A conversation consists of many Messages

### ER-Model Prototype

[](#er-model-prototype)

[![ER-Model](https://camo.githubusercontent.com/9b3d59a45711e27964fcc847ea3b3e42641d660367189dfd98ae0c610dd4514b/68747470733a2f2f676f6f676c6564726976652e636f6d2f686f73742f30425f46565752596a36735137574734325456703255305a6d614451)](https://camo.githubusercontent.com/9b3d59a45711e27964fcc847ea3b3e42641d660367189dfd98ae0c610dd4514b/68747470733a2f2f676f6f676c6564726976652e636f6d2f686f73742f30425f46565752596a36735137574734325456703255305a6d614451)

\##Requirements

- Eloquent ORM

\##Installation

First of all, integrate the source code into your project. You can do it, by adding the package name to your composer.json file and calling the update function:

*You will find a "require" section (enclosed within two curly brackets) in your project's composer file. Please add the given line (project name and version) there. The different package-requirements should be separeted with an comma, but the last one should not be terminated!*

example of an valid composer.json file:

```
 {
    "name": "company/yourproject",
	"description": "some bla bla",
	"keywords": ["framework", "laravel"],
	"license": "free like free beer",
	"require": {
		"laravel/framework": "4.0.*",
		"pichkrement/messenger": "dev-master"
        },
	"autoload": {
		"classmap": [
			"app/commands",
			"app/controllers",
			"app/models",
			"app/database/migrations",
			"app/database/seeds",
			"app/tests/TestCase.php"
		]
	},
	"scripts": {
		"post-install-cmd": [
			"php artisan optimize"
		],
		"post-update-cmd": [
			"php artisan clear-compiled",
			"php artisan optimize"
		],
		"post-create-project-cmd": [
			"php artisan key:generate"
		]
	},
	"config": {
		"preferred-install": "dist"
	},
	"minimum-stability": "dev"
 }
```

Now you have to update your changes and integrate it. Call the *composer install* and *artisan migrate* command in the base-directory of your project (this is the parent folder of ./app ./public and ./src):

```
composer install && composer dump-autoload
php artisan migrate --package "pichkrement/messenger"
```

If the first command does not work, you should check your composer installation! Is it installed and global available? (You will find one of the best installation guides [right here](http://askubuntu.com/questions/116960/global-installation-of-composer-manual#165241)). The second command migrates the database (if it throws an error, it's probably because your database is not configured yet. Just take a look at [this page](http://laravel.com/docs/database#configuration) for more details)

Usage
-----

[](#usage)

Congratulations! Now you can use the laravel4 messenger.

Just extend your Eloquent ORM models (app/models/\*) with the messenger-base models (Message, User and Conversation). It should look like this:

```
// app/models/Conversation.php
