utk dashboard

This commit is contained in:
hafifierahman
2021-10-27 11:13:20 +08:00
parent b1ddf1c2e0
commit 5351f96d22
6 changed files with 140 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace App\Events;
use Illuminate\Queue\SerializesModels;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class GadaiNotify implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $response;
public $cawangan;
public function __construct($response,$cawangan)
{
$this->response = $response;
$this->cawangan = $cawangan;
}
public function broadcastOn()
{
return ['gadai-notify'];
}
public function broadcastAs()
{
return 'trigger-gadai';
}
}
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace App\Events;
use Illuminate\Queue\SerializesModels;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class KeuntunganNotify implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $response;
public $cawangan;
public function __construct($response,$cawangan)
{
$this->response = $response;
$this->cawangan = $cawangan;
}
public function broadcastOn()
{
return ['keuntungan-notify'];
}
public function broadcastAs()
{
return 'trigger-keuntungan';
}
}
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace App\Events;
use Illuminate\Queue\SerializesModels;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class PetibesiNotify implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $response;
public $cawangan;
public function __construct($response,$cawangan)
{
$this->response = $response;
$this->cawangan = $cawangan;
}
public function broadcastOn()
{
return ['petibesi-notify'];
}
public function broadcastAs()
{
return 'trigger-petibesi';
}
}
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace App\Events;
use Illuminate\Queue\SerializesModels;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class TebusNotify implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $response;
public $cawangan;
public function __construct($response,$cawangan)
{
$this->response = $response;
$this->cawangan = $cawangan;
}
public function broadcastOn()
{
return ['tebus-notify'];
}
public function broadcastAs()
{
return 'trigger-tebus';
}
}
@@ -5,6 +5,8 @@ namespace App\Http\Controllers;
//Events
use App\Events\StatusLiked;
use App\Events\NotifikasiPembayaran;
use App\Events\Dashboard\GadaiNotify;
use Illuminate\Http\Request;
use App\Services\CustomerService;
@@ -184,6 +186,8 @@ class GadaianController extends Controller
$this->AliranTunaiController->alirantunaiGadai($request,$auth_user['name']);
event(new GadaiNotify('lulus',$auth_user['cawangan']));
$request->session()->forget('page_reload');
$request->session()->forget('norujukan');
return redirect()->route('customer_info');
@@ -223,6 +227,8 @@ class GadaianController extends Controller
'norujukan' => $request->norujukan_gadai
])->json();
event(new GadaiNotify('lulus',$auth_user['cawangan']));
$request->session()->forget('page_reload');
$request->session()->forget('norujukan');
return redirect()->route('customer_info');
@@ -2,6 +2,10 @@
namespace App\Http\Controllers;
//Events
use App\Events\Dashboard\TebusNotify;
use App\Events\Dashboard\KeuntunganNotify;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Auth;
@@ -63,6 +67,8 @@ class PenebusanController extends Controller
if($updatetebus)
{
return response('success');
event(new TebusNotify('lulus',$auth_user['cawangan']));
}else{
return response('fail');
}