PHP code example of think.studio / laravel-workcast

1. Go to this page and download the library: Download think.studio/laravel-workcast 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/ */

    

think.studio / laravel-workcast example snippets


$pagination = Workcast::events()->list([ 'limit' => 50 ]);
foreach ($pagination->items() as $item) {
    echo $item['eventPak'];
}

if ($pagination->hasNext()) {
    echo $pagination->nextLink();
    // Workcast::events()->callPagination($pagination->nextLink());
}

$item = Workcast::events()->get(22);
dd($item->json());

use LaravelWorkcast\Endpoints\AbstractEndpoint;
use LaravelWorkcast\Endpoints\HasRestFullRead;
use LaravelWorkcast\Endpoints\WithRestFullRead;
class Presenters extends AbstractEndpoint implements HasRestFullRead
{
    use WithRestFullRead;

    protected int $eventId;

    public function __construct(Auth $auth, int $eventId)
    {
        $this->eventId = $eventId;

        parent::__construct($auth);
    }

    public function baseUrl(): string
    {
        return "presenters/{$this->eventId}/sessions/" . $this->key();
    }

    public function key(): string
    {
        return 'presenters';
    }
}

$pagination = (new Presenters(Workcast::getAuth(), 33))->list([ 'limit' => 50 ]);
bash
php artisan vendor:publish --provider="LaravelWorkcast\ServiceProvider" --tag="config"