Initial commit
This commit is contained in:
25
app/Services/TemporaryFileService.php
Normal file
25
app/Services/TemporaryFileService.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?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' );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user