Skip to content

Commit dd4a830

Browse files
authored
Laravel 3.0.0 (#5663)
1 parent f24c57e commit dd4a830

File tree

7 files changed

+112
-12
lines changed

7 files changed

+112
-12
lines changed

src/platforms/php/guides/laravel/configuration/laravel-options.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ You can also configure what is being monitored automatically. These settings hav
8989
// Indicates if the tracing integrations supplied by Sentry should be loaded
9090
// See all default integration: https://github.com/getsentry/sentry-laravel/tree/master/src/Sentry/Laravel/Tracing/Integrations
9191
'default_integrations' => true,
92+
93+
// Indicates that requests without a matching route should be traced
94+
'missing_routes' => false,
9295
],
9396
```
9497

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
title: Other Versions
33
description: "Learn about using Sentry with Laravel Lumen or Laravel 4.x/5.x/6.x/7.x."
4-
redirect_from:
5-
- /platforms/php/guides/laravel/configuration/other-versions/
64
---
75

86
<PageGrid />

src/platforms/php/guides/laravel/other-versions/laravel4.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Laravel 4.x
33
description: "Learn about using Sentry with Laravel 4.x."
4-
sidebar_order: 800
4+
sidebar_order: 300
55
redirect_from:
66
- /platforms/php/guides/laravel/configuration/other-versions/laravel4/
77
---
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
title: Laravel 5.x
3+
description: "Learn about using Sentry with Laravel 5.x."
4+
sidebar_order: 200
5+
---
6+
7+
<Note>
8+
9+
Laravel 5.x is supported until version 2.14.x of the `sentry/sentry-laravel` package.
10+
11+
</Note>
12+
13+
Laravel is supported using a native package: [sentry-laravel](https://github.com/getsentry/sentry-laravel).
14+
15+
This guide is for Laravel 5.x. We also provide instructions for [the latest Laravel](/platforms/php/guides/laravel/) as well as [Lumen-specific instructions](/platforms/php/guides/laravel/other-versions/lumen/).
16+
17+
18+
## Install
19+
20+
Install the `sentry/sentry-laravel` package:
21+
22+
```bash
23+
composer require "sentry/sentry-laravel:^2.14"
24+
```
25+
26+
If you're on Laravel 5.5 or higher, the package will be auto-discovered. Otherwise, you will need to manually configure it in your `config/app.php`.
27+
28+
```php {filename:config/app.php}
29+
'providers' => array(
30+
// ...
31+
Sentry\Laravel\ServiceProvider::class,
32+
),
33+
'aliases' => array(
34+
// ...
35+
'Sentry' => Sentry\Laravel\Facade::class,
36+
),
37+
```
38+
39+
Add Sentry reporting to `App/Exceptions/Handler.php`.
40+
41+
```php {filename:App/Exceptions/Handler.php}
42+
public function report(Exception $exception)
43+
{
44+
if ($this->shouldReport($exception) && app()->bound('sentry')) {
45+
app('sentry')->captureException($exception);
46+
}
47+
48+
parent::report($exception);
49+
}
50+
```
51+
52+
53+
## Configure
54+
55+
Configure the Sentry DSN with this command:
56+
57+
```shell
58+
php artisan sentry:publish --dsn=___PUBLIC_DSN___
59+
```
60+
61+
It creates the config file (`config/sentry.php`) and adds the `DSN` to your `.env` file.
62+
63+
```shell {filename:.env}
64+
SENTRY_LARAVEL_DSN=___PUBLIC_DSN___
65+
```
66+
67+
68+
## Verify
69+
70+
### Verify With Artisan
71+
72+
You can test your configuration using the provided `sentry:test` artisan command:
73+
74+
```shell
75+
php artisan sentry:test
76+
```
77+
78+
### Verify With Code
79+
80+
You can verify that Sentry is capturing errors in your Laravel application by creating a route that will throw an exception:
81+
82+
```php {filename:routes/web.php}
83+
Route::get('/debug-sentry', function () {
84+
throw new Exception('My first Sentry error!');
85+
});
86+
```
87+
88+
Visiting this route will trigger an exception that will be captured by Sentry.
89+
90+
91+
## Local Development and Testing
92+
93+
When Sentry is installed in your application, it will also be active when you are developing or running tests.
94+
95+
You most likely don't want errors to be sent to Sentry when you are developing or running tests. To avoid this, set the DSN value to `null` to disable sending errors to Sentry.
96+
97+
You can also do this by not defining `SENTRY_LARAVEL_DSN` in your `.env` or by defining it as `SENTRY_LARAVEL_DSN=null`.
98+
99+
If you do leave Sentry enabled when developing or running tests, it's possible for it to have a negative effect on the performance of your application or test suite.
100+
101+
<PageGrid nextPages header="Next Steps" />

src/platforms/php/guides/laravel/other-versions/laravel5-6-7.mdx renamed to src/platforms/php/guides/laravel/other-versions/laravel6-7.mdx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
---
2-
title: Laravel 5.x, 6.x, and 7.x
3-
description: "Learn about using Sentry with Laravel 5.x, 6.x, and 7.x."
4-
sidebar_order: 600
5-
redirect_from:
6-
- /platforms/php/guides/laravel/other-versions/laravel5-6/
7-
- /platforms/php/guides/laravel/configuration/other-versions/laravel5-6/
2+
title: Laravel 6.x, and 7.x
3+
description: "Learn about using Sentry with Laravel 6.x, and 7.x."
4+
sidebar_order: 100
85
---
96

107
Laravel is supported using a native package: [sentry-laravel](https://github.com/getsentry/sentry-laravel).
118

12-
This guide is for Laravel 5.x, 6.x, and 7.x. We also provide instructions for [the latest Laravel](/platforms/php/guides/laravel/) as well as [Lumen-specific instructions](/platforms/php/guides/laravel/other-versions/lumen/).
9+
This guide is for Laravel 6.x, and 7.x. We also provide instructions for [the latest Laravel](/platforms/php/guides/laravel/) as well as [Lumen-specific instructions](/platforms/php/guides/laravel/other-versions/lumen/).
1310

1411

1512
## Install

src/platforms/php/guides/laravel/other-versions/lumen.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Laravel Lumen
33
description: "Learn about using Sentry with Laravel Lumen."
4-
sidebar_order: 100
4+
sidebar_order: 400
55
redirect_from:
66
- /platforms/php/guides/laravel/configuration/other-versions/lumen/
77
---
@@ -16,7 +16,7 @@ This guide is for Laravel Lumen 5+. We also provide instructions for [the latest
1616
Install the `sentry/sentry-laravel` package:
1717

1818
```bash
19-
composer require sentry/sentry-laravel
19+
composer require "sentry/sentry-laravel:^2.14"
2020
```
2121

2222
Register Sentry in `bootstrap/app.php`:

src/platforms/php/guides/laravel/performance/instrumentation/automatic-instrumentation.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ The Laravel integration automatically instruments your application to capture tr
99
- Views
1010
- Queue jobs
1111
- Database queries
12+
- Laravel HTTP Client
1213
- GraphQL operations (when using [Lighthouse](https://lighthouse-php.com/))

0 commit comments

Comments
 (0)