PHP code example of mahmoud-mhamed / laravel-slack-errors-log

1. Go to this page and download the library: Download mahmoud-mhamed/laravel-slack-errors-log 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/ */

    

mahmoud-mhamed / laravel-slack-errors-log example snippets


return [
    'log_error_in_local' => env('SLACK_LOG_ERROR_IN_LOCAL', false),
    'log_header' => env('SLACK_LOG_HEADER', true),
    'header_title' => null, // null = 🚨 env('APP_NAME') Exception Occurred!
    'log_content' => env('SLACK_LOG_CONTENT', true),
    'content' => null, //null = send error message
    'log_url' => env('SLACK_LOG_URL', true),
    'log_auth' => env('SLACK_LOG_AUTH', true),
    'log_trace' => env('SLACK_LOG_TRACE', false),
    'append_message' => null,//string data append to slack log message
];

use Mahmoudmhamed\LaravelSlackErrorsLog\LaravelSlackErrorsLog;

$this->reportable(function (Throwable $e) {
     LaravelSlackErrorsLog::sendSlackError($e);
});
bash
php artisan vendor:publish --tag="laravel-slack-errors-log-config"