PAK Manager hotfix. Forgot to comment in some stuff and fixed file saving.

This commit is contained in:
Vari 2024-08-16 00:30:35 +02:00
parent 4287cdc0f6
commit ee87b7e3c5
2 changed files with 7 additions and 9 deletions

View File

@ -59,7 +59,7 @@ public function store(Request $request)
$gameFile->hash = $filehash;
$gameFile->patchline = $request->input('patchline');
$file->storeAs(str($gameFile->patchline->name)->lower(), $gameFile->name, ['disk' => 'patches']);
GameFile::getDisk()->putFileAs(strtolower($gameFile->patchline->name), $file, $gameFile->name);
$uploadedFiles[] = $gameFile->name;
$gameFile->game_path = $request->game_path[$i];

View File

@ -28,14 +28,12 @@ class GameFile extends Model
protected static ?FilesystemAdapter $disk = null;
// protected static function booted()
// {
// parent::booted();
//
// static::deleting(function (GameFile $gameFile) {
// static::getDisk()->delete($gameFile->getDiskPath());
// });
// }
protected static function booted()
{
static::deleting(function (GameFile $gameFile) {
static::getDisk()->delete($gameFile->getDiskPath());
});
}
public static function getDisk():FileSystemAdapter {
return static::$disk ?? static::$disk = Storage::disk('patches');