Coder Social home page Coder Social logo

social-share's Introduction

Social Share

Social Share is a Laravel package that allows you to connect and post to social platforms such as Twitter, Facebook, and Instagram.

Getting Started

Install the package with the following command

composer require jringeisen/social-share

Social Share depends on Laravel Socialite to be able to connect your social platforms, so make sure to install it.

composer require laravel/socialite

Then migrate the databse

php artisan migrate

How to use Social Share

Social share uses Laravel's Socialite package to connect to your social media platforms. We've provided the following routes for you to use.

Facebook

route('facebook.oauth') // Authenticates facebook and instagram
route('facebook.callback') // Redirect to dashboard and stores pages in database

Twitter

route('twitter.oauth') // Authenticates twitter
route('twitter.callback') // Redirect to dashboard and stores pages in database

Once you have connected your accounts you can post to them by initializing the class you want to post to. For example this is how we would post to our Facebook page.

// Get our Facebook page that was stored in the database when we connected to it.
$page = Jringeisen\SocialShare\SocialPage::where('platform', 'facebook')->first();

// Initialize the Facebook class with our facebook page.
$facebook = new Jringeisen\SocialShare\Facebook($page);

// Post a link with text to Facebook
$facebook->postLink($link, $text);

// Post a photo wtih text to Facebook
$facebook->postPhoto($url, $text);

Todo

  • Create tests.
  • Implement posting images to Twitter.
  • Add other social platforms such as LinkedIn, Youtube, Pinterest.
  • Add callback redirect path to config

social-share's People

Contributors

jringeisen avatar

Stargazers

 avatar Md Abu Bakkar Siddik avatar Sazzad Bin Ashique avatar  avatar

Watchers

 avatar

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.