PHP code example of tvup / laravel-fejlvarp

1. Go to this page and download the library: Download tvup/laravel-fejlvarp 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/ */

    

tvup / laravel-fejlvarp example snippets


return [
    'ipstack' => ['access_key' => env('INCIDENT_MANAGER_IPSTACK_ACCESS_KEY')],

    'pushover' => [
        'userkey' => env('INCIDENT_MANAGER_PUSHOVER_USER_KEY'),
        'apitoken' => env('INCIDENT_MANAGER_PUSHOVER_API_TOKEN'),
    ],

    'slack' => [
        'webhook_url' => env('INCIDENT_MANAGER_SLACK_WEBHOOK_URL'),
    ],

    'mail_recipient' => env('INCIDENT_MANAGER_EMAIL_RECIPIENT'),
];

$hash = config('app.name')
            . $exception->getMessage()
            . preg_replace('~revisions/[0-9]{14}/~', '--', $exception->getFile())
            . $exception->getLine();
        $user = request()->user();

        $data = [
            'hash' => md5($hash),
            'subject' => $exception->getMessage() ? $exception->getMessage() : 'Subject is empty',
            'data' => json_encode([
                'application' => config('app.name'),
                'error' => [
                    'type' => get_class($exception),
                    'message' => $exception->getMessage(),
                    'code' => $exception->getCode(),
                    'file' => $exception->getFile(),
                    'line' => $exception->getLine(),
                    'trace' => $exception->getTraceAsString(),
                ],
                'environment' => [
                    'GET' => $_GET ?: null,
                    'POST' => $_POST ?: null,
                    'SERVER' => $_SERVER ?: null,
                    'SESSION' => request()->hasSession() ? request()->session()->all() : null,
                ],
                'application_data' => $user ? [
                    'user' => $user->toArray(),
                ] : null,
                'queries' => app(Listener::class)->queries(),
            ], JSON_THROW_ON_ERROR),
        ];
        $request = Request::create(
            '/api/incidents', 
            'POST', 
            $data, 
            [], 
            [], 
            ['CONTENT_TYPE'=>'application/x-www-form-urlencoded']
        );
        app()->handle($request);
bash
php artisan fejlvarp:install
bash
php artisan vendor:publish --tag="fejlvarp-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="fejlvarp-config"
bash
php artisan vendor:publish --tag="fejlvarp-views"
bash
php artisan vendor:publish --tag=fejlvarp-provider