Skip to content

Commit

Permalink
Wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fr3on committed May 4, 2023
1 parent e334d94 commit f46117c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,12 @@ SLEUREN_KEY=
> **SLEUREN_KEY:** is your Project API key which you've received when creating a project.
Get the variables from your [Sleuren dashboard](https://sleuren.com/dashboard).

Run this in your terminal to test if everything is working:
```bash
php artisan sleuren:test
```

## Documentation

For more information, see the [documentation](https://help.sleuren.com).
6 changes: 4 additions & 2 deletions src/Sleuren.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,10 @@ public function getExceptionData(Throwable $exception)
$data['method'] = Request::method();
$data['route'] = Request::path();
$data['fullUrl'] = Request::fullUrl();
$data['controller'] = Request::route()->getAction()['controller'] ?? '-';
$data['middleware'] = implode(',', Request::route()->gatherMiddleware()) ?? '-';
if (Request::route()) {
$data['controller'] = Request::route()->getAction()['controller'] ?? '-';
$data['middleware'] = implode(',', Request::route()->gatherMiddleware()) ?? '-';
}
$data['exception'] = $exception->getMessage() ?? '-';
$data['line'] = $exception->getLine();
$data['file'] = $exception->getFile();
Expand Down
2 changes: 1 addition & 1 deletion tests/SleurenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function it_can_get_formatted_exception_data()
$this->assertSame('http://localhost', $data['fullUrl']);
$this->assertSame('it_can_get_formatted_exception_data', $data['exception']);

$this->assertCount(13, $data);
$this->assertCount(18, $data);
}

/** @test */
Expand Down

0 comments on commit f46117c

Please sign in to comment.