Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jarektkaczyk committed Jul 17, 2018
1 parent 7fd07db commit b2b3990
Showing 1 changed file with 9 additions and 26 deletions.
35 changes: 9 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,10 @@


## Usage
After you [installed](#installation) the package you can customize the thresholds publish configuration by calling:

```
$ php artisan vendor:publish --provider="Sofa\DbQueriesAlert\ServiceProvider"
```
Add `EloquentTestsuite` trait to your PHPUnit Test:

and edit it in `config/db_queries_alert.php`:
```php
return [
'error' => 100,
'warning' => 50,
'info' => 20,
];
```


Now you're good to go. The package will call `Log::error` (or `warning|info`) whenever your app hits given threshold. Catch this error in the monitoring service you're using for the application (or simply check your local `storage/logs/laravel[-YYYY-MM-DD].log` file).


## Installation

1. Add package to your project:
```
path/to/your/app$ composer require sofa/eloquent-testsuite
```
2. Add `EloquentTestsuite` trait to your PHPUnit Test:
```php
// app/Http/Kernel.php
class SomeModelTest extends \PHPUnit\Framework\TestCase
{
use EloquentSuite;
Expand All @@ -61,6 +36,14 @@ Now you're good to go. The package will call `Log::error` (or `warning|info`) wh
```


## Installation

Add package to your project:

```
path/to/your/app$ composer require sofa/eloquent-testsuite
```

#### Contribution

All contributions are welcome, PRs must be **PSR-2 compliant**.

0 comments on commit b2b3990

Please sign in to comment.