I need convert my json data in file .json
. I parsing data to array of json
in this code
$movies = Movie::all();
return response()->json($movies);
I need create movies.json
file. Where my file must be, which folder? And how to it?
use
use Illuminate\Support\Facades\Storage;
and then
Storage::disk('public')->put('movies.json', response()->json($movies));
and this file will be save in public folder
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With