Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store data in another connection #308

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
tambah relasi message dan messageable
  • Loading branch information
mohamad-supangat committed May 27, 2022
commit 7f26cb5a3cbef7816ecab2af6fda34c1c82cd852
11 changes: 11 additions & 0 deletions src/Models/MessageNotification.php
Original file line number Diff line number Diff line change
@@ -15,6 +15,17 @@ class MessageNotification extends BaseModel
protected $fillable = ['messageable_id', 'messageable_type', 'message_id', 'conversation_id'];
protected $dates = ['deleted_at'];


public function messageable()
{
return $this->morphTo();
}

public function message()
{
return $this->belongsTo(Message::class, 'message_id');
}

/**
* Creates a new notification.
*