update all controller frontend for kadar anggota koperasi
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||
|
||||
class NotifikasiAnggota implements ShouldBroadcast
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
public $nokp;
|
||||
public $status; // DILULUSKAN atau DITOLAK
|
||||
public $siri;
|
||||
public $komen;
|
||||
public $tagoperasi;
|
||||
|
||||
public function __construct($nokp, $status, $siri, $komen, $tagoperasi = null)
|
||||
{
|
||||
$this->nokp = $nokp;
|
||||
$this->status = strtoupper($status); // pastikan huruf besar DILULUSKAN/DITOLAK
|
||||
$this->komen = $komen;
|
||||
$this->tagoperasi = $tagoperasi;
|
||||
}
|
||||
|
||||
public function broadcastOn()
|
||||
{
|
||||
return ['notice-anggota'];
|
||||
}
|
||||
|
||||
public function broadcastAs()
|
||||
{
|
||||
return 'my-anggota';
|
||||
}
|
||||
|
||||
public function broadcastWith()
|
||||
{
|
||||
return [
|
||||
'noic' => $this->nokp,
|
||||
'status' => $this->status, // ikut format API updateAnggota
|
||||
'komen' => $this->komen,
|
||||
'tagoperasi' => $this->tagoperasi,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user