1. Go to this page and download the library: Download hiddeco/laravel-giphy library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hiddeco / laravel-giphy example snippets
class GifController extends BaseController {
public function __construct(HiddeCo\Giphy\Giphy $giphy)
{
$this->giphy = $giphy;
}
public function get($id)
{
try
{
return $this->giphy->gif()->random([ 'fmt' => 'html' ]);
}
catch (\Exception $e)
{
return $e->getMessage();
}
}
}