refactor: comment controller

- Complete Dynamic Properties
- Simplify If Else To Ternary
This commit is contained in:
HDVinnie
2020-12-31 12:59:25 -05:00
parent c413575d44
commit 0cf935033e
+2 -5
View File
@@ -42,6 +42,7 @@ use Illuminate\Http\Request;
*/
class CommentController extends Controller
{
public $tag;
/**
* CommentController Constructor.
*
@@ -118,11 +119,7 @@ class CommentController extends Controller
$comment
);
} else {
if ($comment->anon) {
$sender = 'Anonymous';
} else {
$sender = $user->username;
}
$sender = $comment->anon ? 'Anonymous' : $user->username;
$this->taggedUserRepository->messageTaggedCommentUsers(
'collection',
$request->input('content'),