定制 wuemv/content-sdk-laravel 二次开发

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

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

wuemv/content-sdk-laravel

最新稳定版本:v0.1.0

Composer 安装命令:

composer require wuemv/content-sdk-laravel

包简介

Laravel integration for the Wue Content SDK — service provider, facade, config publishing.

README 文档

README

Laravel integration for the Wue Content SDK. Adds a service provider, a Wue facade, and publishable config.

Install

composer require wuemv/content-sdk-laravel

Auto-discovered — no provider registration needed.

Configure

Add to your .env:

WUE_API_KEY=wue_...
WUE_BASE_URL=https://your-wue-instance.com/api
WUE_SITE_ID=portfolio          # optional, for clarity
WUE_HTTP_VERIFY_SSL=true        # set false for local Herd dev

Optionally publish the config to customise further:

php artisan vendor:publish --tag=wue-config

Usage

Via facade

use Wuemv\ContentSdk\Laravel\Facades\Wue;

$health = Wue::ping()->check();

$types = Wue::contentTypes()->list();

$entries = Wue::entries()->list('blog');

Via container injection

use Wuemv\ContentSdk\Client;

class BlogController
{
    public function __construct(private Client $wue) {}

    public function index()
    {
        $posts = $this->wue->entries->list('blog');
        return view('blog.index', compact('posts'));
    }
}

The Client is bound as a singleton — same instance across the request lifecycle, same HTTP client, same connection pool.

With codegen types

Generate typed Entry classes (from the SDK package's binary):

vendor/bin/wue-types \
  --api-key=$WUE_API_KEY \
  --base-url=$WUE_BASE_URL \
  --output=app/Wue \
  --namespace='App\Wue'

Then in your controllers:

use App\Wue\BlogEntry;
use App\Wue\ContentType;

$posts = Wue::entries()->list(ContentType::Blog);
// Returns BlogEntry[] — typed accessors available
foreach ($posts as $post) {
    /** @var BlogEntry $post */
    echo $post->title();
    echo $post->coverImage();
}

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固