jrm2k6 / laradit
Reddit API Wrapper for Laravel
Installs: 1 674
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 1
Open Issues: 1
Requires
- php: >=5.3.0
- guzzlehttp/guzzle: ^6.1
Requires (Dev)
- laravel/framework: >=5.0
- mockery/mockery: 0.9.*
- phpunit/phpunit: 4.*
This package is not auto-updated.
Last update: 2024-11-15 10:34:11 UTC
README
##Installation
composer require jrm2k6/laradit
Configuration
Add in config/app.php
:
'providers' => [
JD\Laradit\LaraditAuthenticationServiceProvider::class,
JD\Laradit\LaraditResourceServiceProvider::class,
]
Add in your .env file:
LARADIT_CLIENT_ID=your-client-id
LARADIT_CLIENT_SECRET=yout-client-secret
LARADIT_OAUTH_REDIRECT_URI=your-callback
LARADIT_REDDIT_USERNAME=your-username
LARADIT_REDDIT_PASSWORD=your-password
LARADIT_USER_AGENT=your-user-agent
Usage
To get a authentication token for script apps:
LaraditAuth::getScriptAuthenticationManager()->getAccessToken();
You can then set the token:
Laradit::setAuthToken($authToken);