| Package Data | |
|---|---|
| Maintainer Username: | Ben-Speakman | 
| Maintainer Contact: | ben@3sq.re (Ben Speakman) | 
| Package Create Date: | 2015-11-30 | 
| Package Last Update: | 2020-05-31 | 
| Language: | PHP | 
| License: | MIT | 
| Last Refreshed: | 2025-10-30 03:00:23 | 
| Package Statistics | |
|---|---|
| Total Downloads: | 10,171 | 
| Monthly Downloads: | 27 | 
| Daily Downloads: | 2 | 
| Total Stars: | 13 | 
| Total Watchers: | 7 | 
| Total Forks: | 15 | 
| Total Open Issues: | 2 | 
Laravel 5 package for the Wordpress JSON REST API
Simply add the following line to your composer.json and run install/update:
"threesquared/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(
  Threesquared\LaravelWpApi\LaravelWpApiServiceProvider::class
)
'aliases' => array(
  'WpApi' => Threesquared\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 Threesquared\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);