Laravel Vapor - Update Log::channel for development environment only

This commit is contained in:
Dillon Ngo
2024-08-28 18:14:21 +08:00
parent 40746b2a12
commit ed32a6b440
3 changed files with 9 additions and 8 deletions
@@ -3,7 +3,7 @@
namespace App\Classes\Modules\Accounts\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\General\LogHelper;
use App\Classes\General\Services\GeneratesInitials;
use App\Classes\Modules\Accounts\Processors\AuthenticationProcessor;
use App\Classes\Modules\Accounts\Processors\CreateUserProcessor;
@@ -190,7 +190,7 @@ class CreateCustomerLogic extends AbstractControllerLogic
'portal' => 'izyim'
];
$response = Http::post($url, $payload);
Log::channel('wac_webhook')->info('Register Account: ' . json_encode($response));
LogHelper::channel('wac_webhook')->info('Register Account: ' . json_encode($response));
}
// $this->generateEmailVerificationAttemptProcessor->execute($user);
@@ -202,7 +202,7 @@ class CreateCustomerLogic extends AbstractControllerLogic
// register account on exchange portal if this registration not coming from exchange
$exchangeCompanyId = $this->registerOnExchangeProcessor->execute($request, $companyModule->id);
}
if ($exchangeCompanyId) {
// create exchange company connection
$this->connectCompanyModuleToExchangeCompany->execute($companyModule, $exchangeCompanyId);
@@ -85,7 +85,7 @@ class CreateInvoiceTransactionProcessor
->exists();
if ($hasInvoiceCreated) {
Log::channel('wac_webhook')->info('Regenerating Invoice for PackingList: ' . $ori_packing_list->id . '. No call wac api.');
LogHelper::channel('wac_webhook')->info('Regenerating Invoice for PackingList: ' . $ori_packing_list->id . '. No call wac api.');
}
$packing_list = PackingList::where('reference', $packingList->reference)->where('type', PackingListType::SHIPPING_PACKING_LIST)->first();
@@ -286,9 +286,9 @@ class CreateInvoiceTransactionProcessor
'invoice_count' => $invoiceCount,
];
Log::channel('wac_webhook')->info('Attempt to send wac_webhook - Invoice Created: ' . json_encode($payload));
LogHelper::channel('wac_webhook')->info('Attempt to send wac_webhook - Invoice Created: ' . json_encode($payload));
$response = Http::post(config('wagWebhookUrl.invoice_created_url'), $payload);
Log::channel('wac_webhook')->info('Invoice Created: ' . json_encode($response));
LogHelper::channel('wac_webhook')->info('Invoice Created: ' . json_encode($response));
}
return;
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\Wac\ControllersLogic;
use App\Classes\Exceptions\RequestValidationException;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\General\LogHelper;
use App\Classes\Modules\Accounts\DataTransferObjects\RegistrationObject;
use App\Classes\Modules\Companies\DataTransferObjects\EmploymentObject;
use App\Classes\Modules\HelpMenu\Standards\Rules\CanFetchHelpMenuQuestion;
@@ -24,7 +25,7 @@ use App\Classes\ValueObjects\Constants\RoleTypes;
class RegisterExchangeEmailLogic extends AbstractControllerLogic
{
/**
/**
* @return array
*/
protected function notification(): array
@@ -110,7 +111,7 @@ class RegisterExchangeEmailLogic extends AbstractControllerLogic
$newUser->status = ApprovalStatus::APPROVED;
$newUser->save();
Log::channel('wac_webhook')->info('Wac created user: ' . $exchangeEmail);
LogHelper::channel('wac_webhook')->info('Wac created user: ' . $exchangeEmail);
$companyModule = $izyimUser->companyModule->first();
$Object = new EmploymentObject($companyModule, $newUser);