MarketController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use GuzzleHttp\Client;
class MarketController extends Controller
{
public function getMarkets()
{
$client = new Client();
$response = $client->request('GET', 'https://api.tradingview.com/v1/symbols/groups');
$markets = json_decode($response->getBody()->getContents());
return response()->json($markets);
}
}
web.php
<?php
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\MarketController;
Route::get('/', function () {
return view('welcome');
});
Route::get('/markets', [MarketController::class, 'getMarkets']);
Сама ошибка
Скриншот фрагмента кода удалён модератором.