PHP code example of zerkxubas / social-share-laravel

1. Go to this page and download the library: Download zerkxubas/social-share-laravel 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/ */

    

zerkxubas / social-share-laravel example snippets


use Zerkxubas\SocialShareLaravel\SocialShare;

SocialShare::generate($platform,$url);

// OR,

SocialShare::generate($platform,$url,$og_title,$og_description);

use Zerkxubas\SocialShareLaravel\SocialShare;

// Basic usage
$facebookUrl = SocialShare::generate('facebook', 'https://localhost/blog/social-share-laravel');

// Or
$facebookUrl = SocialShare::generate('facebook', route('blog.posts',$id));

// With Open Graph (og) title and description
$twitterUrl = SocialShare::generate('twitter', 'https://example.com', 'Example Title', 'Example Description');


php artisan vendor:publish --tag=socialshare