Showing data for a chat with another user
You can break the functionality in to 2 seperate methods to make it more reusable. Here, findChatByUsers could return a collection or null, so the type hint was removed.

public function findChatByUsers(User $user, User $contraUser)
{
    $chat = $this-&gt;chatRepository
        -&gt;findByUsers($user, $contraUser)
        -&gt;first();

    return $chat;
}

public function getChat(User $user, User $contraUser) : Collection
{
    $chat = $this-&gt;findChatByUsers($user, $contraUser);

    // If chat is not available, create new chat
    if (!$chat) {
        $chat = $this-&gt;chatRepository-&gt;create();
        $member = $this-&gt;chatMemberRepository-&gt;create($chat, $user);
        $contraMember = $this-&gt;chatMemberRepository-&gt;create($chat, $user);
        $chat = $this-&gt;chatRepository-&gt;find($chat-&gt;id);
    }

    return $chat;
}