Skip to content

recoded-dev/wp-query

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6eeb571 · Feb 26, 2021

History

4 Commits
Mar 24, 2020
Mar 24, 2020
Mar 24, 2020
Apr 5, 2020
Feb 26, 2021

Repository files navigation

WP Query

wp-query is a simple way to query data from Wordpress in Laravel

Installation

To install all you need to do is:

composer require recoded/wp-query

Usage

You can display a post very simply like this:

<?php

use Illuminate\Support\Facades\Route;
use Recoded\WpQuery\Database\Models\Post;

Route::get('post/{post}', function (Post $post) {
    return $post;
});

The default Post model has the following relations which you can query (and eagerload):

  • author (User)
  • categories (Category)
  • featuredMedia (Media)
  • replies (Comment)

The default Comment model also has a children relationship. This contains all comments that have the current comment as parent.

About

Query Wordpress posts directly from Laravel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages