PHP code example of phpclaw / phpclaw-laravel
1. Go to this page and download the library: Download phpclaw/phpclaw-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/ */
phpclaw / phpclaw-laravel example snippets
use PhpClaw\Contracts\ClawInterface;
class DashboardController
{
public function __construct(private readonly ClawInterface $phpclaw) {}
public function summary()
{
return $this->phpclaw->send('Summarise this week\'s signups.')->text;
}
}
bash
php artisan phpclaw "how many users signed up this week?"
php artisan phpclaw "check queue health" --stream
php artisan phpclaw:chat
bash
php artisan phpclaw "how many users signed up this week?"