1. Go to this page and download the library: Download teners/laravel-link-preview 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/ */
teners / laravel-link-preview example snippets
use Teners\LaravelLinkPreview\LinkPreview;
// Get link preview for any URL
$preview = LinkPreview::getPreview('https://example.com');
// Returns an array with extracted metadata
/*
[
'title' => 'Example Website',
'description' => 'This is an example website description',
'cover' => 'https://example.com/image.jpg',
'author' => 'John Doe',
'keywords' => 'example, website, demo',
'icon' => 'https://example.com/favicon.ico',
'video' => 'https://example.com/video.mp4',
'video_type' => 'video/mp4'
]
*/