jenssegers / laravel-rollbar

Rollbar error monitoring integration for Laravel projects
328 stars 98 forks source link

use specified rollbar person_fn function #19

Closed jnbn closed 8 years ago

jnbn commented 9 years ago

You can now assign and use person_fn from config file and use any user-defined helper function to pass person data to rollbar object.

'rollbar' => array(
        'access_token' => 'XXX',
        'person_fn' => 'get_rollbar_user',
        'level' => 'debug'
    ),
function get_rollbar_user() {
    if (Auth::check()) {
        $user = Auth::user();
        return array(
            'id' => $user->id, // required - value is a string
            'username' => $user->fullName(), // required - value is a string
            'email' => $user->email, // optional - value is a string
        );
    }
    return null;
}
jenssegers commented 9 years ago

Before calling the function, you should check if the function exists.

jnbn commented 9 years ago

@jenssegers Is everything ok? :)

jnbn commented 9 years ago

anything else?

jenssegers commented 9 years ago

Why did you change the resolved to isset?

jnbn commented 8 years ago

It was from https://github.com/jenssegers/laravel-rollbar/commit/063f9c317ab0314a457dbd19bf4ed81deee1d8d1