jrm2k6 / laradit by jrm2k6

Reddit API Wrapper for Laravel
1,674
4
2
Package Data
Maintainer Username: jrm2k6
Maintainer Contact: jeremy.dagorn@gmail.com (Jeremy Dagorn)
Package Create Date: 2015-12-09
Package Last Update: 2017-07-03
Language: PHP
License: MIT
Last Refreshed: 2024-11-14 15:03:07
Package Statistics
Total Downloads: 1,674
Monthly Downloads: 1
Daily Downloads: 0
Total Stars: 4
Total Watchers: 2
Total Forks: 1
Total Open Issues: 1

##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);