a4x/laravel-wordpress
Laravel-Wordpress
This library wraps your blog posts into a Laravel collection.
Installation
composer require "a4x/laravel-wordpress:0.0.1-beta"
Once this has finished, you will need to add the service provider to the providers array in your app.php config as follows:
'A440\Wordpress\WordpressServiceProvider'
Finally, you will want to publish the config using the following command:
php artisan vendor:publish --provider="A440\Wordpress\WordpressServiceProvider"
Then, update your config/wordpress.php file with your Wordpress installation URL or IP.
And you're done!
Basic Usage
<?php
namespace App\Http\Controllers;
use A440\Wordpress\Wordpress;
class HomeController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(Wordpress $wp)
{
$posts = $wp->posts()
->sortByDesc('date')
->where('author.name', 'Matthew Crist')
->forPage(1, 4);
dd($posts);
}
}
Now you can access your blog posts and categories just like from an Eloquent model.
Related Packages
webwizo/laravel-shortcodes
Wordpress like shortcodes for Laravel 5, 6, 7, 8, 9, 10, 11 and 12
735,406
217
pixelpeter/laravel5-woocommerce-api-client
Laravel 5 wrapper for the Woocommerce REST API
106,676
123
mikemclin/laravel-wp-password
Laravel package that checks and creates WordPress password hashes
3,667,582
86
composer/installers
A multi-framework Composer library installer
150,078,828
1,440
agl
annotatecms
attogram
bitrix
cakephp
chef
cockpit
codeigniter
concrete5
concretecms
croogo
dokuwiki
dolibarr
drupal
elgg
eliasis
expressionengine
ez platform
fuelphp
grav
hurad
imagecms
installer
itop
kanboard
known
kohana
lan management system
laravel
lavalite
lithium
magento
majima
mako
mantisbt
matomo
mautic
maya
mediawiki
miaoxing
modulework
modx
modx evo
moodle
osclass
oxid
pantheon
phpbb
piwik
plentymarkets
porto
ppi
processwire
puppet
pxcms
radphp
reindex
roundcube
shopware
silverstripe
smf
starbug
sydes
sylius
tastyigniter
thelia
whmcs
wolfcms
wordpress
yawik
zend
zikula