Skip to content

Commit

Permalink
enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
Enas committed Jul 31, 2024
1 parent 07e140a commit 117f463
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
9 changes: 0 additions & 9 deletions src/Models/Discussion.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,6 @@ public function messages()
})->orderBy('messaging_messages.created_at', 'desc');
}

/**
* Get the participable that created the first message.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function creator()
{
return User::where('id', $this->created_by)->first();
}

/* -----------------------------------------------------------------
| Scopes
Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/DiscussionTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function transform(Discussion $discussion)
'id' => $discussion->id,
'checkbox' => $this->addCheckbox($discussion->hashed_id),
'icon' => $this->addIcon($status),
'creator' => $discussion->creator() ? '<b>' . $discussion->creator()->name . '</b>' : '',
'creator' => $discussion->creator ? '<b>' . $discussion->creator->name . '</b>' : '',
'subject' => '<a href="' . $show_url . '">' . \Str::limit($discussion->subject, 50) . '</a>',
'participations' => formatArrayAsLabels($participations, 'info'),
'created_at' => format_date($discussion->created_at),
Expand Down

0 comments on commit 117f463

Please sign in to comment.