26 lines
457 B
PHP
26 lines
457 B
PHP
|
|
<?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' );
|
||
|
|
}
|
||
|
|
}
|