mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Request listeners
This commit is contained in:
parent
bb2863783d
commit
b164218d26
43
app/Listeners/LogRequestSending.php
Normal file
43
app/Listeners/LogRequestSending.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Listeners;
|
||||||
|
|
||||||
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||||
|
use Illuminate\Foundation\Events\Dispatchable;
|
||||||
|
use Illuminate\Http\Client\Events\RequestSending;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
|
||||||
|
class LogRequestSending
|
||||||
|
{
|
||||||
|
|
||||||
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the event listener.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handle(RequestSending $event)
|
||||||
|
{
|
||||||
|
nlog("Request");
|
||||||
|
nlog($event->request->headers());
|
||||||
|
nlog($event->request->url());
|
||||||
|
nlog(json_encode($event->request->headers()));
|
||||||
|
nlog($event->request->body());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -137,7 +137,7 @@ use App\Events\Document\DocumentWasRestored;
|
|||||||
use App\Events\Invoice\InvoiceWasMarkedSent;
|
use App\Events\Invoice\InvoiceWasMarkedSent;
|
||||||
use App\Events\Vendor\VendorContactLoggedIn;
|
use App\Events\Vendor\VendorContactLoggedIn;
|
||||||
use App\Listeners\Quote\QuoteViewedActivity;
|
use App\Listeners\Quote\QuoteViewedActivity;
|
||||||
use App\Listeners\Request\LogRequestSending;
|
use App\Listeners\LogRequestSending;
|
||||||
use App\Listeners\User\ArchivedUserActivity;
|
use App\Listeners\User\ArchivedUserActivity;
|
||||||
use App\Listeners\User\RestoredUserActivity;
|
use App\Listeners\User\RestoredUserActivity;
|
||||||
use App\Listeners\Quote\QuoteApprovedWebhook;
|
use App\Listeners\Quote\QuoteApprovedWebhook;
|
||||||
@ -289,6 +289,10 @@ class EventServiceProvider extends ServiceProvider
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
protected $listen = [
|
protected $listen = [
|
||||||
|
|
||||||
|
// RequestSending::class => [
|
||||||
|
// LogRequestSending::class,
|
||||||
|
// ],
|
||||||
// ResponseReceived::class => [
|
// ResponseReceived::class => [
|
||||||
// LogResponseReceived::class,
|
// LogResponseReceived::class,
|
||||||
// ],
|
// ],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user