PHP code example of sinarajabpour1998 / log-manager

1. Go to this page and download the library: Download sinarajabpour1998/log-manager 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/ */

    

sinarajabpour1998 / log-manager example snippets


[
"log_types" => [
        "login" => "ورود به سایت",
        "registration" => "ثبت نام در سایت"
    ]
];

use Sinarajabpour1998\LogManager\Facades\LogFacade;

LogFacade::generateLog("login");

    use Sinarajabpour1998\LogManager\Facades\LogFacade;
    /**
     * Register the exception handling callbacks for the application.
     *
     * @return void
     */
    public function register()
    {
        $this->reportable(function (Throwable $e) {
            // Added for log-manager
            if ($this->shouldReport($e)){
                LogFacade::generateErrorLog($e);
            }
        });
    }
bash
php artisan vendor:publish --tag=log-manager
bash
php artisan vendor:publish --tag=log-manager --force
bash
php artisan migrate
bash
app\Exceptions\Handler.php