Giter VIP home page Giter VIP logo

laravel-linkedin-share's Introduction

Linkedin Share v2 API Integration for Laravel

This package allows you to share content in Linkedin with the v2 API

Installation on Laravel

You can install this package via composer:

composer require lightit/linkedin-share

In Laravel 5.5 the service provider will automatically get registered. In older versions of the Laravel you should add the service provider to the config/app.php file:

'providers' => [
    // ...
    Lightit\LinkedinShare\LinkedinShareServiceProvider::class,
];

You can publish the config file with:

php artisan vendor:publish --provider="Lightit\LinkedinShare\LinkedinShareServiceProvider" --tag="linkedin-share"

After publishing the config file, you should declare the following variables in your .env file.

LINKEDIN_SHARE_REDIRECT_URI={your_redirect_uri}
LINKEDIN_SHARE_CLIENT_ID={your_client_id}
LINKEDIN_SHARE_CLIENT_SECRET={your_client_secret}

Sharing content

You will need the user authentication code ($code) to be able to share content in behalf of the user, you will probabily get this code from the fornt-end of your application.

Sharing text

LinkedinShare::shareNone($code, $text);

Sharing images

LinkedinShare::shareImage($code, $image, $text);

Sharing links

LinkedinShare::shareArticle($code, $url, $text);

Sharing content with access_token

If you prefere to share content using the user access_token, you should include an optional parameter to the share functions. Example:

LinkedinShare::shareNone($access_token, $text, 'access_token');

Extra functionality

Getting access token from authentication code

LinkedinShare::getAccessToken($code)

About Lightit

Light-it is a software development company with offices in Uruguay and Paraguay.

alt text

License

This project and the Laravel framework are open-sourced software licensed under the MIT license.

laravel-linkedin-share's People

Contributors

alanbrande avatar niklaz 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.