Fork from the deprecated "WP API laravel Lib" - threesquared/laravel-wp-api https://github.com/threesquared/laravel-wp-api.git
Go to file
2016-01-22 13:38:09 +00:00
public First commit 2015-01-28 19:11:56 +00:00
src Rename vendor, update guzzle and add test 2016-01-22 13:38:09 +00:00
tests Rename vendor, update guzzle and add test 2016-01-22 13:38:09 +00:00
.gitignore First commit 2015-01-28 19:11:56 +00:00
.travis.yml Rename vendor, update guzzle and add test 2016-01-22 13:38:09 +00:00
composer.json Rename vendor, update guzzle and add test 2016-01-22 13:38:09 +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 Rename vendor, update guzzle and add test 2016-01-22 13:38:09 +00:00

laravel-wp-api

Build Status Latest Stable Version

Laravel 5 package for the Wordpress JSON REST API

Install

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

"threesquared/laravel-wp-api": "~2.0"

Configuration

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

php artisan vendor:publish

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

'providers' => array(
  Threesquared\LaravelWpApi\LaravelWpApiServiceProvider::class
)

'aliases' => array(
  'WpApi' => Threesquared\LaravelWpApi\Facades\WpApi::class
),

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 Threesquared\LaravelWpApi\WpApi class.

Posts

WpApi::posts($page);

Pages

WpApi::pages($page);

Post

WpApi::post($slug);

Categories

WpApi::categories();

Tags

WpApi::tags();

Category posts

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

Author posts

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

Tag posts

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

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

Archive

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