initial commit

This commit is contained in:
2026-06-29 13:00:18 +06:00
commit f2aea74471
3931 changed files with 562423 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Services;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Storage;
class ManageFile
{
const DISK = 'public';
const RESOURCE_DIR = 'resources';
public function uploadFile($file_path,$file_name,$content){
Storage::disk(self::DISK)->put(self::RESOURCE_DIR.DIRECTORY_SEPARATOR.$file_path.DIRECTORY_SEPARATOR.$file_name,$content);
}
public function uploadHTML($file_path,$file_name,$content){
Storage::disk(self::DISK)->put(self::RESOURCE_DIR.DIRECTORY_SEPARATOR.$file_path.DIRECTORY_SEPARATOR.$file_name,$content);
}
public function getFile($file_path): string
{
if (!Storage::disk(self::DISK)->exists(self::RESOURCE_DIR.DIRECTORY_SEPARATOR.$file_path)) {
return "";
}
return Storage::disk(self::DISK)->get(self::RESOURCE_DIR.DIRECTORY_SEPARATOR.$file_path);
}
public function deleteFile($file_path){
return Storage::disk(self::DISK)->delete(self::RESOURCE_DIR.DIRECTORY_SEPARATOR.$file_path);
}
}