I'm using Laravel-5
right now and I've just created a JSON
file called test(test.json). My question is:
This is what I've tried which is obviously wrong:
$string = file_get_contents("../json/test.json");
$json_file = json_decode($string, true);
Thank you so much for helping!
You can store it in your storage folder in Laravel:
$path = storage_path() . "/json/${filename}.json"; // ie: /var/www/laravel/app/storage/json/filename.json
$json = json_decode(file_get_contents($path), true);