Skip to content

Commit

Permalink
docs: update readme (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
atymic authored Nov 7, 2019
1 parent 2e76b60 commit 06bdb51
Showing 1 changed file with 37 additions and 51 deletions.
88 changes: 37 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,65 @@
# Twitter
# Laravel Twitter

Twitter API for Laravel 4/5
[![Latest Version on Packagist](https://img.shields.io/packagist/v/thujohn/twitter.svg?style=flat-square)](https://packagist.org/packages/thujohn/twitter)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Build Status](https://img.shields.io/travis/atymic/twitter/master.svg?style=flat-square)](https://travis-ci.org/atymic/twitter)
[![StyleCI](https://styleci.io/repos/11009743/shield)](https://styleci.io/repos/11009743)
[![Total Downloads](https://img.shields.io/packagist/dt/thujohn/twitter.svg?style=flat-square)](https://packagist.org/packages/thujohn/twitter)

You need to create an application and create your access token in the [Application Management](https://apps.twitter.com/).

[![Build Status](https://travis-ci.org/thujohn/twitter.png?branch=master)](https://travis-ci.org/thujohn/twitter)
Twitter API for Laravel 5.5+ & 6.x

You need to create an application and create your access token in the [Application Management](https://apps.twitter.com/).

## Installation

Add `thujohn/twitter` to `composer.json`.
```
"thujohn/twitter": "~2.0"
composer require thujohn/twitter
```

Run `composer update` to pull down the latest version of Twitter.
## Configuration

Or run
```
composer require thujohn/twitter
```
Just set the below environment variables in your `.env`.

Now open up `/config/app.php` and add the service provider to your `providers` array.
```php
'providers' => [
Thujohn\Twitter\TwitterServiceProvider::class,
]
```

Now add the alias.
```php
'aliases' => [
'Twitter' => Thujohn\Twitter\Facades\Twitter::class,
]
TWITTER_CONSUMER_KEY=
TWITTER_CONSUMER_SECRET=
TWITTER_ACCESS_TOKEN=
TWITTER_ACCESS_TOKEN_SECRET=
```

### Advanced configuration

## Upgrading from 1.x.x

The package now requires PHP >= 5.4.0

Facade has changed (Thujohn\Twitter\Facades\Twitter)

Config file has been updated (debug, UPLOAD_URL, ACCESS_TOKEN_URL, REQUEST_TOKEN_URL)
Run `php artisan vendor:publish --provider="Thujohn\Twitter\TwitterServiceProvider"`
```
/config/ttwitter.php
```

set_new_config() has been renamed reconfig()
# Roadmap

### 2.x

## Configuration
2.x is in maintenance mode, so we'll continue to add support for new versions, bug fixes, etc but won't be adding new features.
We'll keep the original package namespace & not break backward compatibility.

### Laravel 4
### 3.x

Run `php artisan config:publish thujohn/twitter` and modify the config file with your own informations.
```
/app/config/packages/thujohn/twitter/config.php
```
Also, make sure to remove the env in the config file and replace it with your information.
3.x will be a new major version and will not be backward compatible with 2.x
The main goals of 3.x are

- Removing our dependency on `tmhoauth` which is extremely outdated
- Switching to PSR based modules where possible (PSR7 for requests, PSR3 for logging, etc)
- Take advantage of the newer PHP language features such as typing to make the package more robust
- Decouple the package from Laravel, as there isn't that much logic specific to the framework and it would be good to
be able to use it in other frameworks.

### Laravel 5
We'll release a detailed migration guide to make switching as easy as possible.

Run `php artisan vendor:publish --provider="Thujohn\Twitter\TwitterServiceProvider"` and modify the config file with your own information.
```
/config/ttwitter.php
```
With Laravel 5, it's simple to edit the config.php file - in fact you don't even need to touch it! Just add the following to your .env file and you'll be on your way:
```
TWITTER_CONSUMER_KEY=
TWITTER_CONSUMER_SECRET=
TWITTER_ACCESS_TOKEN=
TWITTER_ACCESS_TOKEN_SECRET=
```
# Usage

## Output format

## Special parameter
You can choose between three different output formats. By default responses will be returned as objects. To change this,
use the `format` option in the parameters you pass to any method.

```
format : object|json|array (default:object)
Expand Down

0 comments on commit 06bdb51

Please sign in to comment.