Route::get('marquee', function(){
echo File::get('\storage\app\marquee.json');
});
我在存储/应用程序中有一个json文件
My question is how can I read this content from controller or route?
Route::get('marquee', function(){
echo File::get('\storage\app\marquee.json');
});
我在存储/应用程序中有一个json文件
My question is how can I read this content from controller or route?
使用Storage
facade:
Storage::disk('local')->get('marquee.json');
The old way, using File
facade (deprecated for Laravel 7):
File::get(storage_path('app/marquee.json'));