krgm.so-manager-dev.com/app/Services/FileService.php

35 lines
719 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace App\Services;
use Illuminate\Http\UploadedFile;
/**
* ファイル入出力サービス
* - 旧UtilsのuploadFile互換ラッパー
*/
class FileService
{
/**
* 画像ファイルを保存(旧互換)
*
* @param UploadedFile $file
* @param string|null $fileNamePrefix
* @return string|false 保存ファイル名
*/
public function uploadImage(UploadedFile $file, ?string $fileNamePrefix = null)
{
return \App\Utils::uploadFile($file, $fileNamePrefix);
}
/**
* 画像URL取得旧互換
*/
public function getImageUrl(string $filename = ''): string
{
return \App\Utils::getImageUrl($filename);
}
}