PHPackages                             mauri870/laravel-linkedin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. mauri870/laravel-linkedin

Abandoned → [https://github.com/artesaos/laravel-linkedin](/?search=https%3A%2F%2Fgithub.com%2Fartesaos%2Flaravel-linkedin)Library[HTTP &amp; Networking](/categories/http)

mauri870/laravel-linkedin
=========================

Linkedin API integration for Laravel Framework

1.0.3(10y ago)61.4k[1 issues](https://github.com/mauri870/laravel-linkedin/issues)MITPHPPHP &gt;=5.5.9

Since Dec 14Pushed 10y ago2 watchersCompare

[ Source](https://github.com/mauri870/laravel-linkedin)[ Packagist](https://packagist.org/packages/mauri870/laravel-linkedin)[ RSS](/packages/mauri870-laravel-linkedin/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (6)Versions (6)Used By (0)

### Linkedin API integration for Laravel Framework

[](#linkedin-api-integration-for-laravel-framework)

[![Build Status](https://camo.githubusercontent.com/c70aff30864a728e25fbf190b06604efffe99799b4368316ced82596ccc4b275/68747470733a2f2f7472617669732d63692e6f72672f6d617572693837302f6c61726176656c2d6c696e6b6564696e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mauri870/laravel-linkedin) [![Coverage Status](https://camo.githubusercontent.com/12182b78128c5c7667cf72488b1a677c35254535495f13e64e50be2b7d40dc72/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6d617572693837302f6c61726176656c2d6c696e6b6564696e2f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/mauri870/laravel-linkedin?branch=master) [![Latest Stable Version](https://camo.githubusercontent.com/7d82633a3a2046df977565c738cf3790e8336b8b023126fb4b49d86330976c4e/68747470733a2f2f706f7365722e707567782e6f72672f6d617572693837302f6c61726176656c2d6c696e6b6564696e2f762f737461626c65)](https://packagist.org/packages/mauri870/laravel-linkedin) [![Total Downloads](https://camo.githubusercontent.com/b7c467de2d9778871dca58d4ead2361b056e2fcf8b57f4c61c09c4a48aef8caa/68747470733a2f2f706f7365722e707567782e6f72672f6d617572693837302f6c61726176656c2d6c696e6b6564696e2f646f776e6c6f616473)](https://packagist.org/packages/mauri870/laravel-linkedin) [![Latest Unstable Version](https://camo.githubusercontent.com/e1dd72d33cfc809066a6ceff65f3cd2795c3c6868ebba2323b31805a2abed459/68747470733a2f2f706f7365722e707567782e6f72672f6d617572693837302f6c61726176656c2d6c696e6b6564696e2f762f756e737461626c65)](https://packagist.org/packages/mauri870/laravel-linkedin) [![License](https://camo.githubusercontent.com/f242df919ca2068c8b49b3915f36a222924dedc52f34c071c52c4c0cbbe66620/68747470733a2f2f706f7365722e707567782e6f72672f6d617572693837302f6c61726176656c2d6c696e6b6564696e2f6c6963656e7365)](https://packagist.org/packages/mauri870/laravel-linkedin)

> # ⚠️ DISCONTINUED AND MIGRATED 🚧
>
> [](#warning-discontinued-and-migrated-construction)
>
> This project is discontinued. I will not offer more support and bugfixes here. For the newer changes, support and improvements please refer to [artesaos/laravel-linkedin](https://github.com/artesaos/laravel-linkedin)

This package is a wrapper for [Happyr/LinkedIn-API-client](https://github.com/Happyr/LinkedIn-API-client). You can view the basic intructions [here](https://github.com/Happyr/LinkedIn-API-client/blob/master/Readme.md). Don't forget to consult the oficial [LinkedIn API](https://developer.linkedin.com/) site.

> I encourage users to test the branch [psr-7](https://github.com/mauri870/laravel-linkedin/tree/psr-7) , which is being adopted the psr-7 structure and the independence of an specific http-client. Once the dependencies are stable I will be merge. Please report any bugs or problems.

###### If you need install on Lumen, go to [Lumen section](#installation-on-lumen)

[](#if-you-need-install-on-lumen-go-to-lumen-section)

### Installation on Laravel

[](#installation-on-laravel)

##### Install with composer

[](#install-with-composer)

```
composer require mauri870/laravel-linkedin
```

##### Add service Provider

[](#add-service-provider)

```
Mauri870\LinkedIn\LinkedinServiceProvider::class,

```

##### Facade

[](#facade)

```
'LinkedIn'  => \Mauri870\LinkedIn\Facades\LinkedIn::class,

```

##### Publish config file

[](#publish-config-file)

```
php artisan vendor:publish --provider="Mauri870\LinkedIn\LinkedinServiceProvider"

```

### Installation on Lumen

[](#installation-on-lumen)

##### Install with composer

[](#install-with-composer-1)

```
composer require mauri870/laravel-linkedin
```

##### Add Service Provider, facade and config parameters to the `bootstrap/app.php` file

[](#add-service-provider-facade-and-config-parameters-to-the-bootstrapappphp-file)

```
$app->register(\Mauri870\LinkedIn\LinkedinServiceProvider::class);
class_alias(\Mauri870\LinkedIn\Facades\LinkedIn::class,'LinkedIn');

config(['linkedin' => [
        'api_key' => env('LINKEDIN_KEY','yourapikey'),
        'api_secret' => env('LINKEDIN_SECRET','yourapisecret')
]]);
```

### Usage

[](#usage)

In order to use this API client (or any other LinkedIn clients) you have to [register your app](https://www.linkedin.com/developer/apps)with LinkedIn to receive an API key. Once you've registered your LinkedIn app, you will be provided with an *API Key* and *Secret Key*, please fill this values on `linkedin.php` config file.

\####Basic Usage The unique difference in this package is the `LinkedIn` facade. Instead of this:

```
$linkedIn=new Happyr\LinkedIn\LinkedIn('app_id', 'app_secret');
$linkedin->foo();
```

you can simple call the facade for anyone method, like this:

```
LinkedIn::foo();
```

The service container automatically return an instance of `LinkedIn` class ready to use

#### LinkedIn login

[](#linkedin-login)

This example below is showing how to login with LinkedIn using `LinkedIn` facade.

```
if (LinkedIn::isAuthenticated()) {
     //we know that the user is authenticated now. Start query the API
     $user=LinkedIn::get('v1/people/~:(firstName,lastName)');
     echo  "Welcome ".$user['firstName'];
     exit();
}elseif (LinkedIn::hasError()) {
     echo  "User canceled the login.";
     exit();
}

//if not authenticated
$url = LinkedIn::getLoginUrl();
echo "Login with LinkedIn";
exit();
```

#### Get basic profile info

[](#get-basic-profile-info)

You can retrive information using the `get()` method, like this:

```
LinkedIn::get('v1/people/~:(firstName,num-connections,picture-url)');
```

This query return an array of information. You can view all the `REST` api's methods in [REST API Console](https://apigee.com/console/linkedin)

#### How to post on LinkedIn wall

[](#how-to-post-on-linkedin-wall)

The example below shows how you can post on a users wall. The access token is fetched from the database.

```
LinkedIn::setAccessToken('access_token_from_db');

$options = ['json'=>
     [
        'comment' => 'Im testing Happyr LinkedIn client with Laravel Framework! https://github.com/mauri870/laravel-linkedin',
        'visibility' => [
               'code' => 'anyone'
        ]
     ]
];

$result = LinkedIn::post('v1/people/~/shares', $options);
```

You may of course do the same in xml. Use the following options array.

```
$options = array(
'format' => 'xml',
'body' => '
 Im testing Happyr LinkedIn client! https://github.com/Happyr/LinkedIn-API-client

   anyone

');
```

Configuration
-------------

[](#configuration)

### The api options

[](#the-api-options)

The third parameter of `LinkedIn::api` is an array with options. Below is a table of array keys that you may use.

Option nameDescriptionbodyThe body of a HTTP request. Put your xml string here.formatSet this to 'json', 'xml' or 'simple\_xml' to override the default value.headersThis is HTTP headers to the requestjsonThis is an array with json data that will be encoded to a json string. Using this option you do need to specify a format.response\_data\_typeTo override the response format for one requestqueryThis is an array with query parameters### Changing request format

[](#changing-request-format)

The default format when communicating with LinkedIn API is json. You can let the API do `json_encode` for you. The following code shows you how.

```
$body = array(
    'comment' => 'Im testing Happyr LinkedIn client! https://github.com/Happyr/LinkedIn-API-client',
    'visibility' => array('code' => 'anyone')
);

LinkedIn::post('v1/people/~/shares', array('json'=>$body));
LinkedIn::post('v1/people/~/shares', array('body'=>json_encode($body)));
```

When using `array('json'=>$body)` as option the format will always be `json`. You can change the request format in three ways.

```
// By setter
LinkedIn::setFormat('xml');

// Set format for just one request
LinkedIn::post('v1/people/~/shares', array('format'=>'xml', 'body'=>$body));
```

### Understanding response data type

[](#understanding-response-data-type)

The data type returned from `LinkedIn::api` can be configured. You may use the `LinkedIn::setResponseDataType` or as an option for `LinkedIn::api`

```
// By setter
LinkedIn::setResponseDataType('simple_xml');

// Set format for just one request
LinkedIn::get('v1/people/~:(firstName,lastName)', array('response_data_type'=>'psr7'));
```

Below is a table that specifies what the possible return data types are when you call `LinkedIn::api`.

TypeDescriptionarrayAn assosiative array. This can only be used with the `json` format.simple\_xmlA SimpleXMLElement. See [PHP manual](http://php.net/manual/en/class.simplexmlelement.php). This can only be used with the `xml` format.psr7A PSR7 response.streamA file stream.stringA plain old string.### Using different scopes

[](#using-different-scopes)

If you want to define special scopes when you authenticate the user you should specify them when you are generating the login url. If you don't specify scopes LinkedIn will use the default scopes that you have configured for the app.

```
$scope = 'r_fullprofile,r_emailaddress,w_share';
//or
$scope = array('rw_groups', 'r_contactinfo', 'r_fullprofile', 'w_messages');

$url = LinkedIn::getLoginUrl(array('scope'=>$scope));
return "Login with LinkedIn";
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~19 days

Total

4

Last Release

3792d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10168637?v=4)[Mauri de Souza Meneguzzo](/maintainers/mauri870)[@mauri870](https://github.com/mauri870)

---

Top Contributors

[![mauri870](https://avatars.githubusercontent.com/u/10168637?v=4)](https://github.com/mauri870 "mauri870 (56 commits)")

---

Tags

apiclientsdkrestintegrationlinkedinlaravel-framework

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mauri870-laravel-linkedin/health.svg)

```
[![Health](https://phpackages.com/badges/mauri870-laravel-linkedin/health.svg)](https://phpackages.com/packages/mauri870-laravel-linkedin)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.7k](/packages/larastan-larastan)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)[artesaos/laravel-linkedin

Linkedin API integration for Laravel and Lumen 5

5666.5k](/packages/artesaos-laravel-linkedin)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45344.0k1](/packages/pressbooks-pressbooks)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
