October 22, 2024
Chicago 12, Melborne City, USA
PHP

Cannot make static method Illuminate\Support\Facades\Http::preventStrayRequests() non static in class Illuminate\Http\Client\PendingRequest


I have error in Laravel

Cannot make static method
Illuminate\Support\Facades\Http::preventStrayRequests() non static in
class Illuminate\Http\Client\PendingRequest

use Illuminate\Support\Facades\Http;

public function parse(string $productId): void
    {
        $this->productId = $productId;
        
        $url = self::DETAIL_URL . $productId;
        
        $response = Http::get($url);
        $json = json_decode($response->body(), true);
        $this->data = $json['data']['products'][0] ?? [];
    }



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video