26 lines
488 B
PHP
26 lines
488 B
PHP
<?php
|
|
|
|
if (!function_exists('getUserFullName')) {
|
|
function getUserFullName(?\App\Models\User $user = null): string
|
|
{
|
|
if (!$user) {
|
|
$user = auth()->user();
|
|
}
|
|
return $user->first_name . ' ' . $user->last_name;
|
|
}
|
|
}
|
|
|
|
if (!function_exists('getImageUrl')) {
|
|
|
|
function getImageUrl(?string $path): ?string
|
|
{
|
|
if (!$path) {
|
|
return null;
|
|
}
|
|
|
|
return \Illuminate\Support\Facades\Storage::url($path);
|
|
}
|
|
|
|
}
|
|
|