Skip to content

Commit

Permalink
switched from eloquent to model for inheritance (musonza#93)
Browse files Browse the repository at this point in the history
* switched from eloquent to model for inheritance
  • Loading branch information
axe1987 authored and musonza committed Jun 22, 2018
1 parent 5e04b33 commit fd1ec49
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
10 changes: 10 additions & 0 deletions src/BaseModel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Musonza\Chat;

use Illuminate\Database\Eloquent\Model;

class BaseModel extends Model
{
protected $prefix = 'mc_';
}
10 changes: 0 additions & 10 deletions src/Model.php

This file was deleted.

4 changes: 2 additions & 2 deletions src/Models/Conversation.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
namespace Musonza\Chat\Models;

use Musonza\Chat\Chat;
use Musonza\Chat\Model;
use Musonza\Chat\BaseModel;
use Musonza\Chat\Models\Message;
use Musonza\Chat\Models\MessageNotification;

class Conversation extends Model
class Conversation extends BaseModel
{
protected $table = 'mc_conversations';
protected $fillable = ['data'];
Expand Down
4 changes: 2 additions & 2 deletions src/Models/ConversationUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Musonza\Chat\Models;

use Eloquent;
use Musonza\Chat\BaseModel;

class ConversationUser extends Eloquent
class ConversationUser extends BaseModel
{
protected $table = 'mc_conversation_user';

Expand Down
4 changes: 2 additions & 2 deletions src/Models/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace Musonza\Chat\Models;

use Eloquent;
use Musonza\Chat\BaseModel;
use Musonza\Chat\Chat;
use Musonza\Chat\Eventing\EventGenerator;
use Musonza\Chat\Eventing\MessageWasSent;
use Musonza\Chat\Models\Conversation;
use Musonza\Chat\Models\MessageNotification;

class Message extends Eloquent
class Message extends BaseModel
{
use EventGenerator;

Expand Down
4 changes: 2 additions & 2 deletions src/Models/MessageNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace Musonza\Chat\Models;

use Eloquent;
use Musonza\Chat\BaseModel;
use Musonza\Chat\Chat;
use Musonza\Chat\Models\Message;
use Illuminate\Support\Facades\Notification;
use Musonza\Chat\Models\Conversation;
use Illuminate\Database\Eloquent\SoftDeletes;

class MessageNotification extends Eloquent
class MessageNotification extends BaseModel
{
use SoftDeletes;

Expand Down
4 changes: 2 additions & 2 deletions src/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Musonza\Chat;

use Eloquent;
use Illuminate\Database\Eloquent\Model;

class User extends Eloquent
class User extends Model
{
}

0 comments on commit fd1ec49

Please sign in to comment.