Files
RomhackPlaza/app/Services/TemporaryFileService.php

26 lines
457 B
PHP
Raw Permalink Normal View History

2026-05-20 18:25:15 +02:00
<?php
namespace App\Services;
use Illuminate\Http\UploadedFile;
class TemporaryFileService {
public const int NB_HOURS_FILES_KEPT = 6;
/**
* Upload a file in the temporary path.
*
* @param UploadedFile|null $file
*
* @return string|bool
*/
public function uploadFile(?UploadedFile $file ): string|bool {
if( !$file )
return false;
return $file->store( 'temp', 'public' );
}
}