Fork from the deprecated "WP API laravel Lib" - threesquared/laravel-wp-api https://github.com/threesquared/laravel-wp-api.git
Go to file
2015-01-28 19:17:42 +00:00
public First commit 2015-01-28 19:11:56 +00:00
src First commit 2015-01-28 19:11:56 +00:00
tests First commit 2015-01-28 19:11:56 +00:00
.gitignore First commit 2015-01-28 19:11:56 +00:00
.travis.yml First commit 2015-01-28 19:11:56 +00:00
composer.json composer description 2015-01-28 19:13:44 +00:00
LICENSE First commit 2015-01-28 19:11:56 +00:00
phpunit.xml First commit 2015-01-28 19:11:56 +00:00
README.md Update README.md 2015-01-28 19:17:42 +00:00

laravel-wp-api

Laravel package for the Wordpress JSON REST API

Install

Simply add the following line to your composer.json and run install/update:

"cyberduck/laravel-wp-api": "dev-master"

Configuration

Publish the package config files to configure the location of your Wordpress install:

php artisan config:publish cyberduck/laravel-wp-api

You will also need to add the service provider and the facade alias to your app/config/app.php:

'providers' => array(
  'Cyberduck\LaravelWpApi\LaravelWpApiServiceProvider'
)

'aliases' => array(
  'WpApi' => 'Cyberduck\LaravelWpApi\Facades\WpApi'
),

Usage

The package provides a simplified interface to some of the existing api methods documented here. You can either use the Facade provided or inject the WpApi class.

Posts

WpApi::posts($page);

Post

WpApi::post($slug);

Categories

WpApi::categories();

Category posts

WpApi::category_posts($slug, $page);

WpApi::search($query, $page);

Archive

WpApi::archive($year, $month, $page);