wuemv / content-sdk-laravel
Laravel integration for the Wue Content SDK — service provider, facade, config publishing.
v0.1.0
2026-05-12 19:22 UTC
Requires
- php: ^8.4
- illuminate/contracts: ^11.0|^12.0|^13.0
- illuminate/support: ^11.0|^12.0|^13.0
- wuemv/content-sdk-php: ^0.1
Requires (Dev)
- laravel/pint: ^1.18
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^3.0
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