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/ */

    

meesoverdevest / wp_on_laravel example snippets


 'providers' = [
   ...
   meesoverdevest\wp_on_laravel\WPServiceProvider::class
 ];
 artisan wol:install $password $email
 artisan wol:install $password $email
 artisan migrate

 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();
 
config/app.php
 php artisan migrate --path=vendor/cartalyst/tags/resources/migrations 

server {
 ...
  location = /blog {
   return 301 /blog/wp-login.php;
  }

  location /blog/wp-json {
    try_files $uri $uri/ /blog/index.php?$query_string;
  }	

  location /blog/wp-admin {
    try_files $uri $uri/ /blog/index.php?$query_string;
  } 

  location / {
    // standard settings
  }
 ...
}