Laravel package for the Wordpress JSON REST API forked from threesquared
swancreative/laravel-wp-api is a Laravel package for laravel package for the wordpress json rest api forked from threesquared.
It currently has 3 GitHub stars and 2.855 downloads on Packagist (latest version 3.1).
Install it with composer require swancreative/laravel-wp-api.
Discover more Laravel packages by swancreative
or browse all Laravel packages to compare alternatives.
Last updated
Laravel 5 package for the Wordpress JSON REST API
Simply add the following line to your composer.json and run install/update:
"mattwilding/laravel-wp-api": "~2.0"
You will need to add the service provider and optionally the facade alias to your config/app.php:
'providers' => array(
Mattwilding\LaravelWpApi\LaravelWpApiServiceProvider::class
)
'aliases' => array(
'WpApi' => Mattwilding\LaravelWpApi\Facades\WpApi::class
),
And publish the package config files to configure the location of your Wordpress install:
php artisan vendor:publish
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 Mattwilding\LaravelWpApi\WpApi class.
WpApi::posts($page);
WpApi::pages($page);
WpApi::post($slug);
WpApi::postId($id);
WpApi::categories();
WpApi::tags();
WpApi::categoryPosts($slug, $page);
WpApi::authorPosts($slug, $page);
WpApi::tagPosts($slug, $page);
WpApi::search($query, $page);
WpApi::archive($year, $month, $page);