定制 a4x/laravel-wordpress 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

a4x/laravel-wordpress

Composer 安装命令:

composer require a4x/laravel-wordpress

包简介

A one-class package that locally caches your Wordpress posts as a Laravel collection

README 文档

README

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.

统计信息

  • 总下载量: 291
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-03-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固