2017 © Pedro Peláez
 

library wp_rest_laravel

image

tradzero/wp_rest_laravel

  • Friday, December 29, 2017
  • by tradzero
  • Repository
  • 1 Watchers
  • 1 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 36 % Grown

The README.md

WPREST

laravel package for easy use wordpress rest api, only provide post, category create and update at this version., (*1)

Prepare

WP REST API V2

All REST API provided by WP REST API V2, if your wordpress version more than 4.7, you can skip this, because it's included in wordpress 4.7, if not, you should install it WP REST API V2 plugin, (*2)

JWT Authentication for WP-API

Wordpress don't provide a easy way to authenticate api, so i decide use JWT plugin to authenticate., (*3)

Here is link, (*4)

Usage

when you installed, you need to configure and enable it., (*5)

Install

$ composer require tradzero/wp_rest_laravel:dev-master -vvv, (*6)

Edit /pathto/config/app.php, (*7)

'providers' => [
    // Other service providers...
    Tradzero\WPREST\WPRESTServiceProvider::class,
],

You can also add alias in, (*8)

'aliases' => [
    'WPREST' => Tradzero\WPREST\Facade::class,
]

Publish config file, (*9)

$ php artisan vendor:publish --provider=Tradzero\WPREST\WPRESTServiceProvider

Configure wordpress.php
enter your wordpress endpoint and account infomation., (*10)

Usage

use Tradzero\WPREST\Resources\Post;
use Tradzero\WPREST\Resources\Category;
use WPREST;

$post = new Post();
$post->setTitle('hello world');
$post->setContent('Its post created using WP REST API');

WPREST::createPost($post);

$post->setId('XX');
WPREST::updatePost($post);

$category = new Category;
$category->setName('category 1');
WPREST::findCategoryOrCreate($category);
// or
WPREST::createCategory($category);
$post->setCategories(array($category));
WPREST::createPost($post);

The Versions

29/12 2017

dev-master

9999999-dev

  Sources   Download

GPLv3

The Requires

 

by 林振宇

29/12 2017

0.03

0.03.0.0

  Sources   Download

GPLv3

The Requires

 

by 林振宇

28/07 2017

0.02

0.02.0.0

  Sources   Download

GPLv3

The Requires

 

by 林振宇

26/07 2017

0.01

0.01.0.0

  Sources   Download

GPLv3

The Requires

 

by 林振宇