2017 © Pedro Peláez
 

library linkedin

This package used for send message using laravel notification service

image

khaninejad/linkedin

This package used for send message using laravel notification service

  • Tuesday, April 17, 2018
  • by copify
  • Repository
  • 1 Watchers
  • 1 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Linkedin notification channel for Laravel 5.3+

This package makes it easy to send notifications using Linkedin with Laravel 5.3+., (*1)

Contents

Installation

You can install this package via composer:, (*2)

``` bash composer require khaninejad/linkedin@dev-master, (*3)


Next add the service provider to your `config/app.php`: ```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:, (*4)

...
'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., (*5)

Usage

Follow Laravel's documentation to add the channel to your Notification class., (*6)

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., (*7)

public function toLinkedin($notifiable)
{
    return new LinkedinMessage('Laravel notifications are awesome!');
}

Changelog

Please see CHANGELOG for more information what has changed recently., (*8)

Testing

bash $ composer test, (*9)

Security

If you discover any security related issues, please use the issue tracker., (*10)

Contributing

Please see CONTRIBUTING for details., (*11)

Credits

License

The MIT License (MIT). Please see License File for more information., (*12)

The Versions