1. Go to this page and download the library: Download brain-nucleus/client 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/ */
brain-nucleus / client example snippets
use Brain\Client\BrainEventClient;
class QuoteController extends Controller
{
public function store(Request $request, BrainEventClient $brain)
{
$quote = Quote::create($request->validated());
$brain->send('quote.created', [
'quote_id' => $quote->id,
'email' => $quote->email,
'amount' => $quote->total,
]);
return response()->json($quote);
}
}