All checks were successful
Deploy preview (main_go) / deploy (push) Successful in 14s
- SHJ-9: 日次売上集計処理 - SHJ-10: 年次月次売上集計処理 - SHJ-6: サーバ死活監視処理 - 各種モデルサービスコマンド追加 - earnings_summary, device, hardware_check_log, print_job_log テーブル用SQL追加
33 lines
616 B
PHP
33 lines
616 B
PHP
<?php
|
|
|
|
namespace App\Support;
|
|
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
/**
|
|
* ファイルユーティリティ
|
|
*/
|
|
class Files
|
|
{
|
|
/**
|
|
* 一時ファイルパス生成
|
|
*/
|
|
public static function tempPath(string $prefix = 'sm_', string $suffix = '.tmp'): string
|
|
{
|
|
$dir = sys_get_temp_dir();
|
|
return $dir.DIRECTORY_SEPARATOR.$prefix.uniqid('', true).$suffix;
|
|
}
|
|
|
|
/**
|
|
* ストレージに保存(簡易)
|
|
*/
|
|
public static function putPublic(string $path, string $contents): bool
|
|
{
|
|
return Storage::disk('public')->put($path, $contents);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|