Merge remote-tracking branch 'origin/staging' into origin/production
This commit is contained in:
@@ -88,8 +88,15 @@ class Helper
|
||||
|
||||
public static function principalName($code)
|
||||
{
|
||||
$principalName = Member::where('member_id', $code)->get()->first();
|
||||
return $principalName->name;
|
||||
$principalName = Member::where('member_id', $code)->first();
|
||||
|
||||
if ($principalName !== null) {
|
||||
return $principalName->name;
|
||||
} else {
|
||||
// Tangani situasi di mana member_id tidak ditemukan
|
||||
return 'Member not found'; // Atau berikan nilai default atau pesan error yang sesuai
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static function userName($id)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\OLDLMS;
|
||||
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
@@ -77,4 +78,17 @@ class User extends Authenticatable
|
||||
{
|
||||
return $this->notificationTokens()->pluck('token')->toArray();
|
||||
}
|
||||
|
||||
protected static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::creating(function ($user) {
|
||||
$user->sIPAddress = request()->ip();
|
||||
});
|
||||
|
||||
static::updating(function ($user) {
|
||||
$user->sIPAddress = request()->ip();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ class UserInsurance extends Model
|
||||
'dTanggalLahir',
|
||||
'nNoKTP',
|
||||
'sNoPolis',
|
||||
'sVerificationCode',
|
||||
'nIDInsurance',
|
||||
'sLayanan',
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user