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
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-12