Report Request LOG dan Final LOG
This commit is contained in:
@@ -9,6 +9,7 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Models\Member;
|
||||
use App\Models\User;
|
||||
use App\Models\Service;
|
||||
|
||||
class Helper
|
||||
@@ -89,6 +90,22 @@ class Helper
|
||||
return $principalName->name;
|
||||
}
|
||||
|
||||
public static function userName($id)
|
||||
{
|
||||
$user = User::find($id);
|
||||
if ($user) {
|
||||
$person = $user->person;
|
||||
if ($person) {
|
||||
return $person->name;
|
||||
} else {
|
||||
return 'Person not found for this user.';
|
||||
}
|
||||
} else {
|
||||
return 'User not found.';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static function serviceName($code)
|
||||
{
|
||||
$serviceName = Service::where('code', $code)->get()->first();
|
||||
@@ -138,6 +155,14 @@ class Helper
|
||||
return $datesAvailabilities;
|
||||
}
|
||||
|
||||
public static function differenceTime($startDate, $endDate){
|
||||
$startTime = Carbon::parse($startDate);
|
||||
$endTime = Carbon::parse($endDate);
|
||||
|
||||
$interval = $endTime->diff($startTime);
|
||||
return $interval->format('%d days, %h hours and %i minutes');
|
||||
}
|
||||
|
||||
public static function dailyAvailabilities($availabilities)
|
||||
{
|
||||
$hours = [
|
||||
|
||||
Reference in New Issue
Block a user