我有一个链接,可从Web链接获取JSON文件,并将其放在123123
中的目录中:
(我添加了实际链接以查看是否存在问题)
storage/app/internal/commons
返回
use Illuminate\Support\Facades\Storage;
downloadLatestId();
function downloadLatestId(){
$contents = file_get_contents("https://static.api.nexon.co.kr/fifaonline4/latest/spid.json");
Storage::disk('local')->put('internal/commons/id.json', $contents);
}
在PHP Fatal error: Uncaught Error: Class 'Storage' not found in C:\dir\to\my\project\app\Commons\web\myCLass.php:12
行中引发了堆栈跟踪。
我的文件目录如下:
Storage::disk
答案 0 :(得分:0)
您必须将其导入顶部:
CREATE TRIGGER validate_sysdescr_trg BEFORE UPDATE ON <YOUR_TABLE>
FOR EACH ROW
EXECUTE PROCEDURE public.validate_sysdescr();
或者,如果您不想导入namespace ...;
use Storage;
,则必须在其前面添加
\
如果它不起作用,请在\Storage::disk('local')->put('internal/commons/id.json', $contents);
数组内的config/app.php
文件内检查是否有以alias
为键的条目;如果不是,请将其添加到您的Storage
数组中:
alias