jonathantorres / laravel-medium-sdk by jonathantorres

Laravel Service Provider for Medium's SDK for PHP.
3,845
21
4
Package Data
Maintainer Username: jonathantorres
Maintainer Contact: jonathantorres41@gmail.com (Jonathan Torres)
Package Create Date: 2017-04-04
Package Last Update: 2022-09-03
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-05-03 03:09:09
Package Statistics
Total Downloads: 3,845
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 21
Total Watchers: 4
Total Forks: 4
Total Open Issues: 0

Laravel Medium SDK

Build Status

Laravel Service Provider for Medium's SDK for PHP. Versions 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6 and 5.7 of the framework are currently supported. Documentation for the SDK can be found here.

Installation via Composer

$ composer require jonathantorres/laravel-medium-sdk

Register the Service Provider

Add the Service Provider to your application's config/app.php file. Must be added to the providers array.

'providers' => [
    JonathanTorres\LaravelMediumSdk\LaravelMediumSdkServiceProvider::class,
]

Publish configuration file

This will publish the configuration file to your app's config directory. The location will be config/laravel-medium-sdk.php. Specify your API settings there.

php artisan vendor:publish

Resolve from Laravel's service container

Now just resolve the JonathanTorres\LaravelMediumSdk\LaravelMediumSdk class from Laravel's service container and start making requests to Medium's API using your credentials. More details on every method for the SDK can be found here.

// using the App facade
$medium = App::make(JonathanTorres\LaravelMediumSdk\LaravelMediumSdk::class);

// resolving from a controller method
public function index(JonathanTorres\LaravelMediumSdk\LaravelMediumSdk $medium)
{
    // use $medium here
}

Running tests

$ composer test

License

This library is licensed under the MIT license. Please see LICENSE for more details.

Changelog

Please see CHANGELOG for more details.

Contributing

Please see CONTRIBUTING for more details.