Skip to content

Commit 5663268

Browse files
authored
Update readme.
1 parent 6036fde commit 5663268

File tree

1 file changed

+27
-21
lines changed

1 file changed

+27
-21
lines changed

README.md

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
# Laravel Zabbix API
1+
## Laravel Zabbix API
22

33
This package provides a Zabbix API library for Laravel Framework. It uses the PhpZabbixApi class generated by the http://github.com/confirm/PhpZabbixApi package.
44

5-
### **NOTE: This version was tested with Zabbix Server 3.0.* only. Not sure if it works with other versions as well.**
5+
> **NOTE:** This version was tested with Zabbix Server 3.0.* only. Not sure if it works with other versions as well.
66
7-
### Installation
7+
#### Installation
88

9-
Enter in your Laravel application folder and require the package:
9+
To get started, you should add the `becker/laravel-zabbix-api` Composer dependency to your project:
1010

1111
```php
1212
composer require becker/laravel-zabbix-api
1313
```
1414

15-
### Register the Service Provider
15+
#### Register the Service Provider
16+
17+
> You can skip this step if you are using Laravel 5.5 or higher. The package is automatically added to the Package Service Providers section of `app.php` file, due to the package auto-discovery feature.
1618
1719
Open up the ``config/app.php``and register the new Service Provider:
1820

@@ -28,28 +30,26 @@ Becker\Zabbix\ZabbixServiceProvider::class,
2830
//...
2931
```
3032

31-
### Publish the configuration file
33+
#### Publish the configuration file
3234

3335
```php
3436
php artisan vendor:publish --tag=zabbix
3537
```
3638
This will create the ``config/zabbix.php`` file.
3739

3840

41+
#### Define your Zabbix Server configurations
3942

40-
### Define your Zabbix Server configurations
41-
42-
At your ``.env`` file, define the new Zabbix parameters:
43+
At your ``.env`` file, define the new Zabbix parameters, **without** any final forward slash:
4344

4445
```php
45-
//.env
46-
4746
ZABBIX_HOST=http://your.zabbix.url
4847
ZABBIX_USERNAME=username
4948
ZABBIX_PASSWORD=password
5049
```
5150

52-
### Use it in your Controller
51+
52+
#### Use it in your Controller
5353

5454
```php
5555
//app/Http/Controllers/TestController.php
@@ -64,27 +64,33 @@ use App\Http\Requests;
6464

6565
class TestController extends Controller
6666
{
67+
/**
68+
* The ZabbixApi instance.
69+
*
70+
* @var \Becker\Zabbix\ZabbixApi
71+
*/
72+
protected $zabbix;
6773

6874
/**
6975
* Create a new Zabbix API instance.
7076
*
7177
* @return void
7278
*/
73-
public function __construct()
74-
{
75-
$this->zabbix = app('zabbix');
76-
}
79+
public function __construct()
80+
{
81+
$this->zabbix = app('zabbix');
82+
}
7783

7884
/**
79-
* Get all the Zabbix host groups
85+
* Get all the Zabbix host groups.
8086
*
81-
* @return array
82-
*/
87+
* @return array
88+
*/
8389
public function index()
8490
{
85-
return $this->zabbix->hostgroupGet(['output' => 'extend']);
91+
return $this->zabbix->hostgroupGet(['output' => 'extend']);
8692
}
8793
}
8894
```
8995

90-
### And that's it! :)
96+
And that's it! :beers:

0 commit comments

Comments
 (0)