feat: implement admin management

This commit is contained in:
2026-08-20 07:56:06 +03:30
parent 9d5e325c3f
commit b31dd1b8fb
15 changed files with 838 additions and 326 deletions
+33
View File
@@ -83,3 +83,36 @@ if (!function_exists('getUserFullName')) {
return $user->first_name . ' ' . $user->last_name;
}
}
if (! function_exists('deleteFile')) {
function deleteFile(?File $file): void
{
if (! $file) {
return;
}
if (Storage::exists($file->path)) {
Storage::delete($file->path);
}
$file->delete();
}
}
if (!function_exists('getFileUrl')) {
function getFileUrl(?int $fileId): ?string
{
if (!$fileId){
return null;
}
$file = File::find($fileId);
if (!$file){
return null;
}
return \Illuminate\Support\Facades\Storage::url($file->path);
}
}