最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

php - Error "This site can’t be reached, localhost refused to connect" after upgrading to Laravel 11 while sen

matteradmin6PV0评论

I am working on a Laravel project that uses Firebase Firestore to manage some data. Initially, I was using Laravel 9, and everything worked fine. However, after upgrading to Laravel 11, I encountered a problem.

When I try to send data to Firestore from Laravel, I receive the following error in my browser: This site can’t be reached, localhost refused to connect.

Here is the code I’m using:

$section = Section::where('id', $brand->section_id)->first();
$testSection = 0;
$testSection = $brand->section_id == 0 
    ? [
        "id" => 0,
        "name" => "",
    ] 
    : [
        "id" => $section->id,
        "name" => $section->name,
    ];

$firestore = app('firebase.firestore')
    ->database()
    ->collection('brands')
    ->document($brand->id)
    ->set([
        "id" => $brand->id,
        "name" => $brand->name,
        "section" => $testSection,
        "image" => $brand->logo,
        "contained" => $brand->contained,
        "vue" => $brand->vue,
        "status" => $brand->status,
    ]);
Post a comment

comment list (0)

  1. No comments so far