Skip to main content
Version: v1.0-alpha.3

ChatSystem Models

Using ChatSystem Models#

use Myckhel\ChatSystem\Models\Conversation;use Myckhel\ChatSystem\Models\Message;use Myckhel\ChatSystem\Models\ConversationUser;use Myckhel\ChatSystem\Models\ChatEvent;
Conversation::get();Message::get();ConversationUser::get();ChatEvent::get();

Controlling ChatSystem Models#

Extending ChatSystem Models#

You may want to take control of some models, for example, caching model queries. You may take control by extending the models and registering the model through the chatsystem config.


namespace App\Models;
use Myckhel\ChatSystem\Models\Message as BaseMessage;use QueryCache;
class Message extends BaseMessage{  use QueryCache;}

Registering ChatSystem Models#

make sure you have published the chatsystem config file. see publishing-the-config-file

...return [...  /*  * Models  */  "models" => [    ...    // register Message model    "message"       => "App\\Models\\Message",  ],...

Using registered ChatSystem models#

use App\Models\Message;
Message::get();