PHP code example of jorenvanhocht / laravel-share

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

    

jorenvanhocht / laravel-share example snippets


// config/app.php
'providers' => [
    Jorenvh\Share\Providers\ShareServiceProvider::class,
];

// config/app.php
'aliases' => [
    'Share' => Jorenvh\Share\ShareFacade::class,
];

Share::currentPage()->facebook();

Share::page('http://jorenvanhocht.be', 'Share title')
	->facebook()
	->twitter()
	->linkedin('Extra linkedin summary can be passed here')
	->whatsapp();

Share::page('http://jorenvanhocht.be', 'Share title')
	->facebook()
	->getRawLinks();

Share::page('http://jorenvanhocht.be', 'Share title')
	->facebook()
	->twitter()
	->linkedin('Extra linkedin summary can be passed here')
	->whatsapp()
    ->getRawLinks();

Share::page('http://jorenvanhocht.be', null, ['class' => 'my-class', 'id' => 'my-id', 'title' => 'my-title', 'rel' => 'nofollow noopener noreferrer'])
    ->facebook();

Share::page('http://jorenvanhocht.be', null, [], '<ul>', '</ul>')
            ->facebook();
bash
php artisan vendor:publish --provider="Jorenvh\Share\Providers\ShareServiceProvider"
laravel-share.php
laravel-share.php
 php
Share::page('http://jorenvanhocht.be')->facebook();
 php
Share::page('http://jorenvanhocht.be')->whatsapp()
html 
https://www.facebook.com/sharer/sharer.php?u=http://jorenvanhocht.be

[
  "facebook" => "https://www.facebook.com/sharer/sharer.php?u=http://jorenvanhocht.be",
  "twitter" => "https://twitter.com/intent/tweet?text=Share+title&url=http://jorenvanhocht.be",
  "linkedin" => "http://www.linkedin.com/shareArticle?mini=true&url=http://jorenvanhocht.be&title=Share+title&summary=Extra+linkedin+summary+can+be+passed+here",
  "whatsapp" => "https://wa.me/?text=http://jorenvanhocht.be",
]