Add feature notify admin when download pdf

This commit is contained in:
Amir
2023-06-18 10:43:00 +08:00
parent 464a7c14d0
commit 4cbf48e56e
6 changed files with 191 additions and 2 deletions
+10 -2
View File
@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use App\Jobs\NotifyJanaNotis;
use Illuminate\Http\Request;
use Spatie\Permission\Models\Role;
use Spatie\Permission\Models\Permission;
@@ -40,8 +41,6 @@ use App\Models\WtdDraft;
use App\Jobs\WhatsappNotisLelongFasa1;
use App\Jobs\WhatsappNotisLelongFasa2;
class NotisController extends Controller
{
/**
@@ -280,6 +279,11 @@ class NotisController extends Controller
$currentdate = Carbon::now();
$tarikh_cetak = $currentdate->toDateString();
$current_date_time = $currentdate->toDateTimeString();
Log::info("Jana notis fasa 1: " . $user->kodcaw . ", " . $user->name);
NotifyJanaNotis::dispatch($user->id, $user->kodcaw, $user->name, 'Jana Notis Fasa 1', $current_date_time);
$lelongid = Lelong::find($lelong_id);
$arraynorujukan = LelongBid::where('lelong_id', $lelong_id)->where('kodcaw', $caw->caw_code)->pluck('norujukan');
@@ -591,6 +595,10 @@ class NotisController extends Controller
// dd($marhuns);
$arraysag = [];
$current_date_time = $current->toDateTimeString();
Log::info("Jana notis fasa 2: " . $user->kodcaw . ", " . $user->name);
NotifyJanaNotis::dispatch($user->id, $user->kodcaw, $user->name, 'Jana Notis Fasa 2', $current_date_time);
foreach($marhuns as $index1=>$cal){
$customer = Customer::where('kpbaru','=',$cal['nokp'])