Looking to hire Laravel developers? Try LaraJobs

laravel-wordpress maintained by vrkansagara

Description
Laravel module using WordPress as the backend API
Last update
2019/01/20 14:54 (dev-master)
License
Downloads
13

Comments
comments powered by Disqus

Laravel WordPress

Need to set up following things in to .env file

VRKANSAGARA_LARAVEL_WORDPRESS_ENABLED=true
DB_WOREDPRESS_PREFIX='wp_'
DB_WOREDPRESS_CONNECTION='mysql-wordpress'
DB_WORDPRESS_DATABASE='wordpress'
DB_WORDPRESS_USERNAME='${DB_USERNAME}'
DB_WORDPRESS_PASSWORD='${DB_PASSWORD}'

How to use it

<?php
    $obj  = new LaravelWordpress();
    $posts = $obj->getPosts()->get();
    foreach ($posts as $k => $post){
        echo $post->name;
        echo $post->description;
        echo $post->title;
        echo $post->content;
    } 

#Note

DB_WOREDPRESS_CONNECTION key must not conflicts with other database key.