Apply fixes from StyleCI
This commit is contained in:
committed by
StyleCI Bot
parent
20f46adbc4
commit
9596d88b48
@@ -7,17 +7,19 @@ use App\Models\File;
|
||||
|
||||
/**
|
||||
* Class FileService
|
||||
* @package App\Services
|
||||
*/
|
||||
class FileService extends Service
|
||||
{
|
||||
/**
|
||||
* Save a file to disk and return a File asset
|
||||
*
|
||||
* @param \Illuminate\Http\UploadedFile $file
|
||||
* @param string $folder
|
||||
* @param array $attrs
|
||||
* @return File
|
||||
*
|
||||
* @throws \Hashids\HashidsException
|
||||
*
|
||||
* @return File
|
||||
*/
|
||||
public function saveFile($file, $folder, array $attrs)
|
||||
{
|
||||
@@ -33,12 +35,12 @@ class FileService extends Service
|
||||
$id = File::createNewHashId();
|
||||
$path_info = pathinfo($file->getClientOriginalName());
|
||||
|
||||
# Create the file, add the ID to the front of the file to account
|
||||
# for any duplicate filenames, but still can be found in an `ls`
|
||||
// Create the file, add the ID to the front of the file to account
|
||||
// for any duplicate filenames, but still can be found in an `ls`
|
||||
|
||||
$filename = $id . '_'
|
||||
. str_slug(trim($path_info['filename']))
|
||||
. '.' . $path_info['extension'];
|
||||
$filename = $id.'_'
|
||||
.str_slug(trim($path_info['filename']))
|
||||
.'.'.$path_info['extension'];
|
||||
|
||||
$file_path = $file->storeAs($folder, $filename, $attrs['disk']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user