LaravelPackages.net
Acme Inc.
Toggle sidebar
astritzeqiri/laravel-wp-api

Laravel package for the Wordpress JSON REST API

897
0
2.1.3
About astritzeqiri/laravel-wp-api

astritzeqiri/laravel-wp-api is a Laravel package for laravel package for the wordpress json rest api. It currently has 0 GitHub stars and 897 downloads on Packagist (latest version 2.1.3). Install it with composer require astritzeqiri/laravel-wp-api. Discover more Laravel packages by astritzeqiri or browse all Laravel packages to compare alternatives.

Last updated

This is a fork of threesquared/laravel-wp-api

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:

"astritzeqiri/laravel-wp-api": "~2.1"

Configuration

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

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

'aliases' => array(
  'WpApi' => AstritZeqiri\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 AstritZeqiri\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);

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

Archive

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

Comments