GithubHelp home page GithubHelp logo

Comments (5)

dbfx avatar dbfx commented on May 24, 2024 2

Thanks all, please try v2.0.2 now and see if fixed?

from laravel-strapi.

eblumstengel-dbkg avatar eblumstengel-dbkg commented on May 24, 2024

I have the exact same problem, which is caused by line 98 of the LaravelStrapi.php vendor class:

        if (!isset($entry['id'])) {
            Cache::forget($cacheKey);

            if (null === $entry) {
                throw new NotFound('The requested single entry (' . $type . ') was null');
            }

            throw new UnknownError('An unknown Strapi error was returned');
        }

As we can see in the screenshot postet above, the data returned via the API has a key "data" at the root level of the response. It seems the check for the entry in the LaravelStrapi.php class is not aware of that and only checks for the key "id", but lacks check of the "data" key. I changed this to:

if (!isset($entry['data']['id'])) {

and that resolves the problem, but is still a change in the vendor-file...

from laravel-strapi.

eblumstengel-dbkg avatar eblumstengel-dbkg commented on May 24, 2024

Tested & works! Thank you very much!

from laravel-strapi.

bast111 avatar bast111 commented on May 24, 2024

Amazing guys Thx for the fix it now works fine!

I do have another problem tho reaching the end of the tutorial.
I did a Route calling the Localite function in the LocaliteController. which return the localites.blade.php view... so far everything works fine
But when trying to access the fields from my Strapi object like the 'nom' or 'npa' it can't be found even id.
image

Could anyone enlight me please :D

from laravel-strapi.

bast111 avatar bast111 commented on May 24, 2024

Here's a var_dump of the localite variable
image

from laravel-strapi.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.