-
-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Your configuration files are not serializable #266
Comments
Yes, that is because you are using a closure in your configuration file which is not allowed :) This is a Laravel limitation (and a good one because serializing closures is a hack). You can get around this limitation by doing the following: <?php
namespace App\Exceptions;
use Sentry\Event;
class Sentry
{
public static function before(Event $event): ?Event
{
// literally anything
return $event;
}
} Which you can set in your configuration like: <?php
return [
'dsn' => env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')),
'before_send' => [App\Exceptions\Sentry::class, 'before'],
]; This works because we allow PHP callables to be passed for all callbacks. |
Because I have not heard back I am going to assume my directions were sufficient and the problem was solved, closing this issue, feel free to reopen or open a new one if there are still unsolved issues. |
doing the following on which file? |
It's not explicitly documented as the config options are passed through directly to Sentry. So when you read something like https://docs.sentry.io/platforms/php/#tagging-events , it's basically the content of |
i don't have that file in config folder |
Seems to me you didn't follow the installation guide then, see e.g. https://sentry.io/for/laravel/ Especially the last step ("create the sentry configuration") |
config/sentry.php
The text was updated successfully, but these errors were encountered: