<?php
namespace App\Logging;

use Monolog\Handler\AbstractProcessingHandler;
use Snowfire\Beautymail\BeautymailFacade;
use Libs\Ntfsender;

class CustomLoggerHandler extends AbstractProcessingHandler
{
    public function write(array $record)
    {

        BeautymailFacade::send('emails.my_mail', ['record' => $record], function ($message)  {
            $message->from('privacy@gmail.com')
                ->to("hello@gmail.com")
                ->subject("Email Log");
        });
        // $ntfy = new Ntfysender();
        // $ntfy->sendNtfy(json_encode($record));
        \Log::info("yoyo");
        \Log::info($record['message']);
        \Log::info(json_encode($record));
        \Log::info("yoyo");
    }
}


?>