PHP code example of davigs / laravel-zabbix-graph
1. Go to this page and download the library: Download davigs/laravel-zabbix-graph library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
davigs / laravel-zabbix-graph example snippets
// config/app.php
'providers' => [
...
CasperBoone\LaravelZabbixGraph\ZabbixGraphServiceProvider::class,
],
// config/app.php
'aliases' => [
...
'ZabbixGraph' => CasperBoone\LaravelZabbixGraph\ZabbixGraphFacade::class,
],
namespace App\Http\Controllers;
use Carbon\Carbon;
use Illuminate\Http\Request;
use CasperBoone\ZabbixGraph\ZabbixGraph;
class GraphsController extends Controller
{
public function show(Request $request, ZabbixGraph $zabbixGraph, $id)
{
$graph = $zabbixGraph->startTime(Carbon::now()->subDay())
->width($request->input('width', 1000))
->height($request->input('height', 200))
->find($id);
return response($graph)
->header('Content-Type', 'image/png');
}
}
namespace App\Http\Controllers;
use ZabbixGraph;
use Carbon\Carbon;
use Illuminate\Http\Request;
class GraphsController extends Controller
{
public function show(Request $request, $id)
{
$graph = ZabbixGraph::startTime(Carbon::now()->subDay())
->width($request->input('width', 1000))
->height($request->input('height', 200))
->find($id);
return response($graph)
->header('Content-Type', 'image/png');
}
}
php artisan vendor:publish --provider="CasperBoone\LaravelZabbixGraph\ZabbixGraphServiceProvider"