swancreative/laravel-wp-api
Larablocks Analysis
swancreative/laravel-wp-api works with any PHP project: the latest release (3.1, Feb 2, 2022) doesn't depend on Laravel.
Laravel 5 and 6 in earlier releases.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- No release in the last 12 months (last: Feb 2, 2022)
- 0 downloads a month (needs 10,000)
- 3 GitHub stars (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Feb 2, 2022.
- No releases in the last 12 months.
- First released: May 31, 2017.
- 2 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 1, 2026.
| Install | |
|---|---|
composer require swancreative/laravel-wp-api |
|
| Latest Version: | 3.1 |
| PHP: | ^7.0|^8.0 |
| Older releases: | 5 · 6 |
| License: | MIT |
| Last Updated: | Feb 2, 2022 |
| Links: | GitHub · Packagist |
laravel-wp-api
Laravel 5 package for the Wordpress JSON REST API
Install
Simply add the following line to your composer.json and run install/update:
"mattwilding/laravel-wp-api": "~2.0"
Configuration
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
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 Mattwilding\LaravelWpApi\WpApi class.
Posts
WpApi::posts($page);
Pages
WpApi::pages($page);
Post
WpApi::post($slug);
WpApi::postId($id);
Categories
WpApi::categories();
Tags
WpApi::tags();
Category posts
WpApi::categoryPosts($slug, $page);
Author posts
WpApi::authorPosts($slug, $page);
Tag posts
WpApi::tagPosts($slug, $page);
Search
WpApi::search($query, $page);
Archive
WpApi::archive($year, $month, $page);
Related Packages
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 3.1 | ^7.0| | MIT | ||
| 3.0 | ^7.0 | MIT | ||
| 2.2 | ^7.0 | MIT | ||
| 2.0 | ^7.0 | ^6.0 | MIT | |
| 1.4 | ^7.0 | ^6.0 | MIT | |
| v1.3 | >=5.5.0 | ~5.2 | MIT | |
| 1.2.3 | >=5.5.0 | ~5.2 | MIT | |
| 1.2.2 | >=5.5.0 | ~5.2 | MIT | |
| 1.2.1 | >=5.5.0 | ~5.2 | MIT | |
| 1.2.0 | >=5.5.0 | ~5.2 | MIT | |
| 1.1.1 | >=5.5.0 | ~5.2 | MIT | |
| 1.1.0 | >=5.5.0 | ~5.2 | MIT | |
| 1.0.0 | >=5.5.0 | ~5.2 | MIT |