PHP code example of wuemv / content-sdk-laravel

1. Go to this page and download the library: Download wuemv/content-sdk-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wuemv / content-sdk-laravel example snippets


use Wuemv\ContentSdk\Laravel\Facades\Wue;

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

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

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

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'));
    }
}

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();
}
bash
php artisan vendor:publish --tag=wue-config