Skip to content

Commit

Permalink
Merge pull request #6 from ARCANEDEV/patch-1
Browse files Browse the repository at this point in the history
Cleaning the package
  • Loading branch information
arcanedev-maroc authored Sep 17, 2017
2 parents 8780117 + e15bf92 commit 8363818
Show file tree
Hide file tree
Showing 28 changed files with 227 additions and 153 deletions.
16 changes: 10 additions & 6 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
* text=auto

/.github export-ignore
/_docs export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore
/phpunit.xml export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.scrutinizer.yml export-ignore
.travis.yml export-ignore
phpunit.xml.dist export-ignore
CONTRIBUTING.md export-ignore
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ matrix:
allow_failures:
- php: nightly

env:
- TESTBENCH_VERSION=3.4.*

before_script:
- travis_retry composer self-update
- travis_retry composer require --prefer-source --no-interaction --dev "orchestra/testbench:${TESTBENCH_VERSION}" "orchestra/database:${TESTBENCH_VERSION}"
- travis_retry composer install --prefer-source --no-interaction

script:
- composer validate
Expand Down
12 changes: 8 additions & 4 deletions _docs/2-Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@ After you've published the config file `config/laravel-messenger.php`, you can c
<?php

return [
/* ------------------------------------------------------------------------------------------------

/* -----------------------------------------------------------------
| Database
| ------------------------------------------------------------------------------------------------
| -----------------------------------------------------------------
*/

'database' => [
'connection' => config('database.default'),
],

/* ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Models
| ------------------------------------------------------------------------------------------------
| -----------------------------------------------------------------
*/

'users' => [
'table' => 'users',
'model' => App\User::class,
Expand All @@ -44,5 +47,6 @@ return [
'table' => 'messages',
'model' => Arcanedev\LaravelMessenger\Models\Message::class
],

];
```
20 changes: 6 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
"license": "MIT",
"require": {
"php": ">=5.6.4",
"arcanedev/support": "~4.0"
"arcanedev/support": "~4.1.0"
},
"require-dev": {
"phpunit/phpcov": "~3.0",
"phpunit/phpunit": "~5.0"
"orchestra/testbench": "~3.4.0",
"orchestra/database": "~3.4.0",
"phpunit/phpcov": "~3.0",
"phpunit/phpunit": "~5.0"
},
"autoload": {
"psr-4": {
Expand All @@ -32,15 +34,5 @@
"psr-4": {
"Arcanedev\\LaravelMessenger\\Tests\\": "tests/"
}
},
"scripts": {
"testbench": "composer require --dev \"orchestra/testbench=~3.0\" \"orchestra/database=~3.0\""
},
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"minimum-stability": "dev",
"prefer-stable" : true
}
}
12 changes: 8 additions & 4 deletions config/laravel-messenger.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<?php

return [
/* ------------------------------------------------------------------------------------------------

/* -----------------------------------------------------------------
| Database
| ------------------------------------------------------------------------------------------------
| -----------------------------------------------------------------
*/

'database' => [
'connection' => config('database.default'),
],

/* ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Models
| ------------------------------------------------------------------------------------------------
| -----------------------------------------------------------------
*/

'users' => [
'table' => 'users',
'model' => App\User::class,
Expand All @@ -32,4 +35,5 @@
'table' => 'messages',
'model' => Arcanedev\LaravelMessenger\Models\Message::class
],

];
16 changes: 10 additions & 6 deletions database/migrations/2016_08_01_000001_create_discussions_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@
* Class CreateDiscussionsTable
*
* @author ARCANEDEV <[email protected]>
*
* @see \Arcanedev\LaravelMessenger\Models\Discussion
*/
class CreateDiscussionsTable extends Migration
{
/* ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Constructor
| ------------------------------------------------------------------------------------------------
| -----------------------------------------------------------------
*/

/**
* CreateParticipantsTable constructor.
* CreateDiscussionsTable constructor.
*/
public function __construct()
{
Expand All @@ -26,10 +29,11 @@ public function __construct()
);
}

/* ------------------------------------------------------------------------------------------------
| Main Functions
| ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Main Methods
| -----------------------------------------------------------------
*/

/**
* Run the migrations.
*/
Expand Down
20 changes: 12 additions & 8 deletions database/migrations/2016_08_01_000002_create_messages_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@
* Class CreateMessagesTable
*
* @author ARCANEDEV <[email protected]>
*
* @see \Arcanedev\LaravelMessenger\Models\Message
*/
class CreateMessagesTable extends Migration
{
/* ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Constructor
| ------------------------------------------------------------------------------------------------
| -----------------------------------------------------------------
*/

/**
* CreateParticipantsTable constructor.
* CreateMessagesTable constructor.
*/
public function __construct()
{
Expand All @@ -26,19 +29,20 @@ public function __construct()
);
}

/* ------------------------------------------------------------------------------------------------
| Main Functions
| ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Main Methods
| -----------------------------------------------------------------
*/

/**
* Run the migrations.
*/
public function up()
{
$this->createSchema(function (Blueprint $table) {
$table->increments('id');
$table->integer('discussion_id')->unsigned();
$table->integer('user_id')->unsigned();
$table->unsignedInteger('discussion_id');
$table->unsignedInteger('user_id');
$table->text('body');
$table->timestamps();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@
* Class CreateParticipantsTable
*
* @author ARCANEDEV <[email protected]>
*
* @see \Arcanedev\LaravelMessenger\Models\Participant
*/
class CreateParticipantsTable extends Migration
{
/* ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Constructor
| ------------------------------------------------------------------------------------------------
| -----------------------------------------------------------------
*/

/**
* CreateParticipantsTable constructor.
*/
Expand All @@ -26,19 +29,20 @@ public function __construct()
);
}

/* ------------------------------------------------------------------------------------------------
| Main Functions
| ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Main Methods
| -----------------------------------------------------------------
*/

/**
* Run the migrations.
*/
public function up()
{
$this->createSchema(function (Blueprint $table) {
$table->increments('id');
$table->integer('discussion_id')->unsigned();
$table->integer('user_id')->unsigned();
$table->unsignedInteger('discussion_id');
$table->unsignedInteger('user_id');
$table->dateTime('last_read')->nullable();
$table->timestamps();
$table->softDeletes();
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions src/Bases/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ abstract class Migration extends BaseMigration
| Traits
| -----------------------------------------------------------------
*/

use ConfigHelper;

/* -----------------------------------------------------------------
| Constructor
| -----------------------------------------------------------------
*/

/**
* Migration constructor.
*/
Expand Down
6 changes: 5 additions & 1 deletion src/Contracts/Discussion.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface Discussion
| Relationships
| -----------------------------------------------------------------
*/

/**
* Participants relationship.
*
Expand Down Expand Up @@ -62,6 +63,7 @@ public function creator();
| Scopes
| -----------------------------------------------------------------
*/

/**
* Scope discussions that the user is associated with.
*
Expand Down Expand Up @@ -107,6 +109,7 @@ public function scopeSubject(Builder $query, $subject, $strict = false);
| Getters & Setters
| -----------------------------------------------------------------
*/

/**
* Get the latest_message attribute.
*
Expand All @@ -118,6 +121,7 @@ public function getLatestMessageAttribute();
| Main Methods
| -----------------------------------------------------------------
*/

/**
* Returns all of the latest discussions by `updated_at` date.
*
Expand Down Expand Up @@ -147,7 +151,7 @@ public function participantsUserIds($userId = null);
/**
* Add a user to discussion as a participant.
*
* @param int $userId
* @param int $userId
*
* @return \Arcanedev\LaravelMessenger\Models\Participant
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Contracts/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ interface Message
| Relationships
| -----------------------------------------------------------------
*/

/**
* Discussion relationship.
*
Expand Down Expand Up @@ -56,6 +57,7 @@ public function participants();
| Getters & Setters
| -----------------------------------------------------------------
*/

/**
* Recipients of this message.
*
Expand Down
3 changes: 3 additions & 0 deletions src/Contracts/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ interface Participant
| Relationships
| -----------------------------------------------------------------
*/

/**
* Discussion relationship.
*
Expand All @@ -40,6 +41,7 @@ public function user();
| Getters & Setters
| -----------------------------------------------------------------
*/

/**
* Get the participant string info.
*
Expand All @@ -51,6 +53,7 @@ public function stringInfo();
| Main Methods
| -----------------------------------------------------------------
*/

/**
* Restore a soft-deleted model instance.
*
Expand Down
Loading

0 comments on commit 8363818

Please sign in to comment.