GithubHelp home page GithubHelp logo

dipesh79 / laravelshare Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 33 KB

Laravel Share. A simple package which allows provide you link to make the current page shareable in different platform.

Home Page: https://dipesh79.github.io/LaravelShare/

PHP 100.00%
laravel share social-media

laravelshare's Introduction

Laravel Share Pacakge

Laravel Share

This Laravel package share the current url page to multiple social media channel.

Usage/Examples

Install Using Composer

composer require dipesh79/laravel-share

Compact the Required Social Media Share Link to blade

use Dipesh79\LaravelShare\LaravelShare;

//Your Controller Method
public function index()
{
  $share = new LaravelShare();
  $facebook_link = $share->facebook();
  //This will share the current url
  
  OR
  
  $facebook_link = $share->facebook("custom_url");
  /This will share the given url.
  //compact the share link to your blade
  return view('index',compact('facebook_link'));
}

After sending the url to blade simply add the url to href tag.

<a href="{{$facebook_link}}" target="_blank">Share To Facebook</a>

OR

use Dipesh79\LaravelShare\LaravelShare;

//Your Controller Method
public function index()
{
  $share = new LaravelShare();
 
  //compact the share link to your blade
  return view('index',compact('share'));
}

After sending the url to blade simply add the url to href tag.

<a href="{{$share->facebook()}}" target="_blank">Share To Facebook</a>

If you have to add in most of the blade files then use it in AppServiceProvider.

use Dipesh79\LaravelShare\LaravelShare;
use Illuminate\Support\Facades\View;

.
.
.

public function boot()
{
    $share = new LaravelShare();
    View::share('share',$share);
}

Then you can use share variable in any blade file in the laravel project. Then simply do {{$share->facebook()}} to add respective social media share link in any blade file.

Currently Available Platform

This package provide the following platform sharing functionality.

  • Facebook {{$share->facebook()}}
  • Twitter {{$share->twitter()}}
  • Linkedin {{$share->linkedin()}}
  • Pinterest {{$share->pinterest()}}
  • WhatsApp {{$share->whatsapp()}}
  • Reddit {{$share->reddit()}}
  • Telegram {{$share->telegram()}}
  • Tumblr {{$share->tumblr()}}
  • Viber {{$share->viber()}}
  • Gmail {{$share->gmail()}}
  • Trello {{$share->trello()}}
  • Facebook Messenger {{$share->messenger()}}
  • Skype {{$share->skype()}}
  • Tencent QQ {{$share->qq()}}

More Coming Soon...

Contact Us we have missed any platform which is used mostly, and it would be helpful to add that platform on this project.

License

MIT

Author

Support

For support, email [email protected].

laravelshare's People

Contributors

dipesh79 avatar sanoj32 avatar

Stargazers

 avatar David Pratama avatar Achyut Neupane avatar

Watchers

 avatar

Forkers

sanoj32

laravelshare's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.