vrkansagara / laravel-wordpress
Laravel module using WordPress as the backend API
1.0.1
2019-01-20 13:54 UTC
Requires
- php: >=7.0
Requires (Dev)
- laravel/framework: 5.5.x
This package is auto-updated.
Last update: 2024-11-22 03:24:16 UTC
README
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.