Answers for "fetch data from api in laravel"

PHP
1

how to save data from api to laravel

$res = $gallery->request('GET','https://www.instagram.com/explore/tags/MIZONEDanceBattle/?__a=1');
    $data = json_decode($res->getBody()->getContents(), true);

    $gallery = Gallery::firtsOrCreate([
            'shortcode',
            'thumbnail_src',
        ], $data]); // add $data here
    $gallery->save();
Posted by: Guest on October-30-2020
-1

laravel get fetch api request body

public function foo(Request $request){
    $bodyContent = $request->getContent();
}
Posted by: Guest on June-05-2021

Browse Popular Code Answers by Language