Comments (9)
also if there is some way to cache the images instead of requesting each time.. much appreciated :)
thanks.
from flickr.
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.
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.
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.
Everything works for me in the way you set it up. Also after a artisan cache:clear
from flickr.
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.
Thank you for your solution!
from flickr.
Any ideas for caching the requests?
from flickr.
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)
- can not make it to work. HOT 7
- (E_DEPRECATED) Non-static method JeroenG\Flickr\Flickr::echoThis() should not be called statically HOT 1
- L5.5 compatible? HOT 6
- A question about accessing photos HOT 2
- Caching the application config breaks the package HOT 3
- Upgrade to Guzzle 7 HOT 2
- Unresolvable Dependency error in Laravel Jetstream with Livewire HOT 2
- Use github actions
- Uncaught TypeError HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flickr.