Giter Club home page Giter Club logo

Comments (9)

mpixelz avatar mpixelz commented on June 2, 2024 1

also if there is some way to cache the images instead of requesting each time.. much appreciated :)
thanks.

from flickr.

Jeroen-G avatar Jeroen-G commented on June 2, 2024

Try replacing env('FLICKR_KEY', '') with env('FLICKR_KEY') so there is no default of no key. Or put in your key directly in that place to see if the error lies with Flickr or Laravel or somewhere else.

Regarding caching: I suppose you can cache with Laravel's system.

from flickr.

mpixelz avatar mpixelz commented on June 2, 2024

Just tried both ways and still the error is the same.

Response {#601 ▼
  #contents: array:3 [▼
    "stat" => "fail"
    "code" => 100
    "message" => "Invalid API Key (Key has invalid format)"
  ]
}

from flickr.

Jeroen-G avatar Jeroen-G commented on June 2, 2024

A quick Google search said something about a api key auth signature. I'll have to play with the issue to see what is happening when I have time. Maybe you can do too. For example with a new key, other functions and calls, etc.

from flickr.

Jeroen-G avatar Jeroen-G commented on June 2, 2024

Everything works for me in the way you set it up. Also after a artisan cache:clear

from flickr.

peterpeerdeman avatar peterpeerdeman commented on June 2, 2024

Hi there,

I had the same problem as @mpixelz and was dumbfounded as to what te solution should be. After some fiddling around I found it out.

The problem did not occur locally, I could only reproduce it on my server environment. The problem was that the method env('ENV_VARIABLE_NAME') does not properly work (and is not intended to work properly) outside the config files in laravel.

@mpixelz, the code you posted in this example is loading the env variable directly into your laravel code (the same way I did in my code), but you should only call the env method inside the config files and use e.g. config('app.timezone') (or in our case config('flickr.key') and create a file config/flickr.php with a key value in the array) when loading variables. This paragraph in the laravel documentation describes it in more detail: https://laravel.com/docs/5.4/configuration#accessing-configuration-values

After I switched to this way of loading the flickr API key, I had no problems anymore, it had nothing to do with @Jeroen-G's excellent Flickr module (thank you btw for creating this!)

from flickr.

Jeroen-G avatar Jeroen-G commented on June 2, 2024

Thank you for your solution!

from flickr.

harishletsgo avatar harishletsgo commented on June 2, 2024

Any ideas for caching the requests?

from flickr.

Jeroen-G avatar Jeroen-G commented on June 2, 2024

Take a look at Laravel's own caching, I think you could use that. If you run into issues with that, feel free to open a new issue.

from flickr.

Related Issues (10)

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.