D
D
Dmitry Lakhno2018-04-14 14:43:01
PHP
Dmitry Lakhno, 2018-04-14 14:43:01

How to save image file from Facebook API link in Laravel 5+?

I get a link like this: https://graph.facebook.com/v2.10/social_id/picture... How can I save this file in the lara?
I tried all the methods from the documentation and nothing works, it only works through the Tinify::fromUrl() optimization package, but I need to keep it as it is.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Lakhno, 2018-04-15
@lahno

The problem was solved by including the intervention/image package. Thanks to all!)

K
Konstantin B., 2018-04-14
@Kostik_1993

In addition to studying the Laravel documentation, I would advise you to study the language itself
$url = " www.google.co.in/intl/en_com/images/srpr/logo1w.png ";
$contents = file_get_contents($url);
$name = basename($url);
Storage::put($name, $contents);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question