2017 © Pedro Peláez
 

library zappem-laravel

Connect your Laravel application to Zappem

image

zappem/zappem-laravel

Connect your Laravel application to Zappem

  • Thursday, November 24, 2016
  • by danjohnson95
  • Repository
  • 1 Watchers
  • 0 Stars
  • 103 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

zappem-laravel

Connect your Laravel application to Zappem, (*1)

Installation

$ composer require zappem/zappem-laravel

Then add the following line to your ServiceProviders array in config/app.php:, (*2)

Zappem\ZappemLaravel\ServiceProvider::class

Configuration

Now you'll need to configure Zappem. You can define your configuration in your env file., (*3)

The env variables are:, (*4)

ZAPPEM_URL=http://localhost:3000
ZAPPEM_PROJECT=123456
ZAPPEM_ENABLE=true
  • ZAPPEM_URL - The full URL (including port number) where Zappem is running.
  • ZAPPEM_PROJECT - The project ID for this application. You can find this on Zappem.
  • ZAPPEM_ENABLE - true/false

Alternatively you can define these values in a configuration file., (*5)

$ php artisan vendor:publish

The configuration file will be located in /config/zappem.php., (*6)

Note: You may need to rebuild the cache when changing config variables in Laravel, (*7)

$ php artisan config:cache

Usage

Your application should report errors to Zappem in the report() function in app/Exceptions/Handler.php., (*8)

Here's an example of how it should look:, (*9)

public function report(Exception $e){
    if(Config::get('services.zappem.zappem_enable')) \Zappem::exception($e)->send();
}

Passing through a user

If your application requires users to log in, you can send the currently logged in user to Zappem. This will then display in Zappem when viewing the exception., (*10)

public function report(Exception $e){
    if(Config::get('services.zappem.zappem_enable')) \Zappem::exception($e)->user(Auth::user()->id)->send();
}

The user() function currently accepts a string or an integer. You should pass through a unique idenfitier of this user. This could be an ID, Email Address etc., (*11)

Getting back an error code

Whenever you send an exception to Zappem, we'll send you back a short unique numeric code. It may be useful to display this to your users. On Zappem you can search for the code and jump to the exception straight away., (*12)

The error code will be contained in the return of sending the exception to us. Here's an example:, (*13)

$Zappem = \Zappem::exception($e)
->user(Auth::user()->id, Auth::user()->name, Auth::user()->email)
->send();

if($Zappem->success){
  return "Sorry, an error occurred. Please contact development quoting this code: ".$Zappem->code;
}

The Versions

24/11 2016

dev-master

9999999-dev https://github.com/danjohnson95/zappem-laravel

Connect your Laravel application to Zappem

  Sources   Download

MIT

tracking bug zappem

24/11 2016

v1.0.5

1.0.5.0 https://github.com/danjohnson95/zappem-laravel

Connect your Laravel application to Zappem

  Sources   Download

MIT

tracking bug zappem

23/11 2016

v1.0.4

1.0.4.0 https://github.com/danjohnson95/zappem-laravel

Connect your Laravel application to Zappem

  Sources   Download

MIT

tracking bug zappem

22/11 2016

v1.0.3

1.0.3.0 https://github.com/danjohnson95/zappem-laravel

Connect your Laravel application to Zappem

  Sources   Download

MIT

tracking bug zappem

22/11 2016

v1.0.2

1.0.2.0 https://github.com/danjohnson95/zappem-laravel

Connect your Laravel application to Zappem

  Sources   Download

MIT

tracking bug zappem

21/11 2016

dev-feature/wip

dev-feature/wip https://github.com/danjohnson95/zappem-laravel

Connect your Laravel application to Zappem

  Sources   Download

MIT

tracking bug zappem

21/11 2016

1.0.0

1.0.0.0 https://github.com/danjohnson95/zappem-laravel

Connect your Laravel application to Zappem

  Sources   Download

MIT

tracking bug zappem