• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

RonasIT / laravel-chat / 22632431448

03 Mar 2026 04:25PM UTC coverage: 98.671% (-0.1%) from 98.78%
22632431448

push

github

web-flow
Merge pull request #50 from RonasIT/86c86krgq_Extend-chat-to-work-with-multi-member-chats-2

86c86krgq extend chat to work with multi member chats 2

55 of 56 new or added lines in 11 files covered. (98.21%)

297 of 301 relevant lines covered (98.67%)

22.18 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.71
/src/Http/Requests/Messages/ReadMessagesRequest.php
1
<?php
2

3
namespace RonasIT\Chat\Http\Requests\Messages;
4

5
use RonasIT\Chat\Contracts\Requests\ReadMessagesRequestContract;
6
use RonasIT\Chat\Contracts\Services\MessageServiceContract;
7
use RonasIT\Chat\Models\Message;
8
use RonasIT\Support\Http\BaseRequest;
9
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
10

11
class ReadMessagesRequest extends BaseRequest implements ReadMessagesRequestContract
12
{
13
    protected ?Message $message;
14

15
    public function authorize(): bool
16
    {
17
        return $this->message->conversation->hasMember($this->user());
7✔
18
    }
19

20
    public function validateResolved(): void
21
    {
22
        $this->init();
7✔
23

24
        $this->checkMessageExists();
7✔
25

26
        parent::validateResolved();
7✔
27
    }
28

29
    protected function checkMessageExists(): void
30
    {
31
        if (empty($this->message)) {
7✔
NEW
32
            throw new NotFoundHttpException(__('chat::validation.exceptions.not_found', ['entity' => 'Message']));
×
33
        }
34
    }
35

36
    protected function init(): void
37
    {
38
        $this->message = app(MessageServiceContract::class)->with('conversation')->find($this->route('id'));
7✔
39
    }
40
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc