Looking to hire Laravel developers? Try LaraJobs

content-sdk-laravel maintained by wuemv

Description
Laravel integration for the Wue Content SDK — service provider, facade, config publishing.
Author
Last update
2026/05/12 21:22 (dev-main)
License
Downloads
1
Tags

Comments
comments powered by Disqus

wuemv/content-sdk-laravel

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