PHP code example of meesoverdevest / wp_on_laravel
1. Go to this page and download the library: Download meesoverdevest/wp_on_laravel library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use meesoverdevest\wp_on_laravel\helpers\WPAPI;
function syncWP(){
$WPAPI = new WPAPI();
$WPAPI->syncWP();
}
// WPPost
use meesoverdevest\wp_on_laravel\models\WPPost;
// WPCategory
use meesoverdevest\wp_on_laravel\models\WPCategory;
// Tag (managed by Cartalyst/Tags)
use meesoverdevest\wp_on_laravel\models\Tag;
// Show WPCategories for post
$posts = WPPost::where('parent', 0)->first()->categories();
// Show WPosts for tag
$tag = Tag::first()->posts();
// Show children WPCategories for parent WPCategory
$tag = WPCategory::first()->children();