Level 13
Not 100% sure what you're trying to achieve here, so something like this? Or am I totally not on the right track?
Route::get('/my-route', function() {
$json = json_decode(file_get_contents('path/to/json/file.php'));
});
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi I have a php file which gets a json count of google + pluses how do I grab the output of this file from the routes file ?
Many thanks in advance
Not 100% sure what you're trying to achieve here, so something like this? Or am I totally not on the right track?
Route::get('/my-route', function() {
$json = json_decode(file_get_contents('path/to/json/file.php'));
});
Please or to participate in this conversation.