PHP code example of prajwal89 / laravel-share-to

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

    

prajwal89 / laravel-share-to example snippets


// config/app.php
'providers' => [
    Prajwal89\LaravelShareTo\LaravelShareToServiceProvider::class,
];

use Prajwal89\LaravelShareTo\Share;

$options = [

    'tracking' => true, //this will keep track of share in track_shares table 

    //options for container
    'buttonGap' => 10, //in px
    'alignment' => 'center', // accepts (start|center|end) alignment of of buttons in container

    //options for button
    'borderWidth' => 2,
    'radius' => 4,
    'paddingX' => 4,
    'paddingY' => 8,
];

$share =  Share::Page('McqMate - MCQ Portal for Students', 'https://mcqmate.com', $options);

echo $share->all()->getButtons();


echo $share->all()->getButtons();

echo $share->facebook()->getButtons();

echo $share->whatsapp()->twitter()->getButtons();
//or
echo $share->only(['whatsapp','twitter'])->getButtons();

echo $share->all()->getRawLinks();
//or
echo $share->only(['whatsapp','twitter'])->getRawLinks();
bash
php artisan vendor:publish --provider="Prajwal89\LaravelShareTo\LaravelShareToServiceProvider"
bash
php artisan migrate