Need help with laravel-wp-api?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

Cyber-Duck
126 Stars 47 Forks MIT License 20 Commits 2 Opened issues

Description

Laravel package for the Wordpress JSON REST API

Services available

!
?

Need anything else?

Contributors list

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:
"cyberduck/laravel-wp-api": "~1.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

app/config/app.php
:
'providers' => array(
  'Cyberduck\LaravelWpApi\LaravelWpApiServiceProvider'
)

'aliases' => array( 'WpApi' => 'Cyberduck\LaravelWpApi\Facades\WpApi' ),

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 WpApi class.

Posts

WpApi::posts($page);

Pages

WpApi::pages($page);

Post

WpApi::post($slug);

Categories

WpApi::categories();

Tags

WpApi::tags();

Category posts

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

Search

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

Archive

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

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.