Giter Site home page Giter Site logo

laravel-chat-system's Introduction

ChatSystem

Latest Version on Packagist Total Downloads Tests Status

This is where your description should go. Take a look at contributing.md to see a to do list.

Installation

Via Composer

$ composer require myckhel/laravel-chat-system

Documentaion

Postman Documentaion

Examples

Laravel Inertia React

Expo Snack

Usage

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits

License

license. Please see the license file for more information.

laravel-chat-system's People

Contributors

dependabot[bot] avatar hmreumann avatar myckhel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

laravel-chat-system's Issues

Add `type` column to conversation

Adding a type column would make the lib get prepared for group conversation support.

  • type should be an enum with values [private, group, issue]
  • type should be indexed
  • type should have private as default

TODOS

  • add type column to conversation migration
  • update conversation model with type changes.

Create Interface for all models

This will enable to type hint values properly and ensures arguments types are the expected types

Given the example type hint below

use Myckhel\ChatSystem\Contracts\IConversation;

function deleteConversation(IConversation $conversation){
    $conversation->delete();
}

Models interfaces should be created to the directory /Contracts

  • create Conversation Interface
  • create Message Interface
  • create Conversation User Interface
  • create Chat Event Interface
  • type hint methods referencing models

Add metas column to Message

Replace Metas by adding metas column to Message model.

metas column schema: json

CheckList:

  • add metas column to message
  • delete Metas model, migration, trait and relationship
  • remove metas config refs from chatsystem's config
  • update MessageController@store token creation by using message.metas column to store token
  • remove metas refs from MessageController@index

Create `conversation->addParticipant($user)` method

Notes*

  • method should add the given user as a participants

  • method should create a message of type = activity, message = '{User->name ?? "user"} joined the conversation'

  • Create conversation->addParticipant($user, ?$activityMessage) method

  • create POST conversations/{convasation}/join endpoint

  • allow participant join conversation if not private type

Create `conversation->removeParticipant($user)` method

Notes*

  • method should remove the given user as a participants

  • method should create a message of type = activity, message = '{User->name ?? "user"} left the conversation'

  • Create conversation->removeParticipant($user, ?$activityMessage) method

  • create DELETE conversations/{convasation}/join endpoint

  • allow participant leave conversation if not private type

Add conversation `isParticipant` property

Add isParticipant property to conversationController@index & @show response.
user is likely not to be a participant of the conversation.
adding the isParticipant will determine if the user is a participant of the conversation

Message/Conversation Resources Cleanup

Delete Linked resources when both parties has deleted message/conversation.
i.e relations and medias

  • create message deleted observe to check and delete resources if all parties have deleted
  • create message deleted observe to check and delete resources if all parties have deleted

#6 (comment)

Dont load `migrations` by default

Prevent loading migrations by default to encourage users publish migration files and modify.

when user run php artisan migrate, automatically it applies to chatsystem migrations without the user publishing the migration files.

it would be a good idea to always encourage the users to publish migration files so that they can modify the migrations to their tastes.

so when user run php artisan migrate it wouldn't automatically applied to chatsystem migrations until user manually publish the migration files.

Class App\Models\User contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Myckhel\ChatSystem\Contracts\ChatEventMaker::chatEventMakers)

Hello how are you???
I tried to implement the
* Myckhel\ChatSystem\Contracts\ChatEventMaker contract, in User Model, but I got an error
* Class App\Models\User contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Myckhel\ChatSystem\Contracts\ChatEventMaker::chatEventMakers); How can i fix that???
* I noticed in the API that we need 3 variables (name, email and password) to connect, but I only use 2 variables (username and password).
* how i want to handle this too???
* I also tried ChatSystem Broadcast Events;

var current_username = "{{ Auth::user()->username }}";
var current_user = "{{ Auth::user()}}";
var userid = "{{ Auth::id() }}";

Echo.private(message-event.user+userid)
.listen('message', (event) => {
console.log(event)
})
I got Error
[01:12:34] - 9BEdhJIOfQvhZG32AAAE could not be authenticated to private-message-event.user.9
{
"message": "Myckhel\ChatSystem\Broadcasting\Chat\UserMessageChannel::join(): Argument #2 ($messagesUser) must be of type Myckhel\ChatSystem\Broadcasting\Chat\User, string given, called in /var/www/eglise.local/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php on line 279",
"exception": "TypeError",
"file": "/var/www/eglise.local/vendor/myckhel/laravel-chat-system/src/Broadcasting/Chat/UserMessageChannel.php",
can you help me solve his errors please? Thank you!!!!!!!

Add `type` column to `message`

  • type should be an enum with values [user, system, activity]
  • type should be indexed
  • type should have user as default

TODOS

  • add type column to message migration
  • update message model with type changes.

Fix php v8.1 Deprecated methods

Fix:
Calling static trait method Myckhel\ChatSystem\Traits\Config::config is deprecated, it should only be called on a class using the trait in /Applications/XAMPP/xamppfiles/htdocs/laravel-chat-system-example/vendor/myckhel/laravel-chat-system/src/Events/Message/Created.php on line 27

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.