khaninejad / linkedin
This package used for send message using laravel notification service
Requires
- php: >=5.6.4
- guzzlehttp/psr7: ^1.4
- happyr/linkedin-api-client: ^1.0
- illuminate/notifications: ^5.3
- illuminate/support: ^5.1|^5.2|^5.3
- php-http/curl-client: ^1.7
- php-http/message: ^1.6
Requires (Dev)
- mockery/mockery: ^0.9.5
- phpunit/phpunit: 4.*
This package is not auto-updated.
Last update: 2025-04-02 06:18:19 UTC
README
This package makes it easy to send notifications using Linkedin with Laravel 5.3+.
Contents
- Installation
- Setting up the Linkedin service
- Usage
- Changelog
- Testing
- Security
- Contributing
- Credits
- License
Installation
You can install this package via composer:
composer require khaninejad/linkedin@dev-master
Next add the service provider to your config/app.php
:
... 'providers' => [ ... khaninejad\linkedin\LinkedinServiceProvider::class, ], ...
Setting up the Linkedin service
You will need to create a Linkedin app in order to use this channel. Within in this app you will find the keys and access tokens
. Place them inside your .env
file. In order to load them, add this to your config/services.php
file:
... 'linkedin' => [ 'client_id' => env('LINKEDIN_KEY'), 'client_secret' => env('LINKEDIN_SECRET'), 'redirect' => env('LINKEDIN_REDIRECT_URI'), 'access_token' => env('LINKEDIN_Access_TOKEN') ] ...
This will load the Linkedin app data from the .env
file. Make sure to use the same keys you have used there like LINKEDIN_KEY
.
Usage
Follow Laravel's documentation to add the channel to your Notification class.
Publish Linkedin status update
use khaninejad\linkedin\LinkedinChannel; use khaninejad\linkedin\LinkedinMessage; class NewsWasPublished extends Notification { /** * Get the notification's delivery channels. * * @param mixed $notifiable * @return array */ public function via($notifiable) { return [LinkedinChannel::class]; } public function toLinkedin($notifiable) { return new LinkedinMessage('Laravel notifications are awesome!'); } }
Take a closer look at the StatusUpdate
object. This is where the magic happens.
public function toLinkedin($notifiable) { return new LinkedinMessage('Laravel notifications are awesome!'); }
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Security
If you discover any security related issues, please use the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.