1. Go to this page and download the library: Download cboxdk/laravel-postal 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/ */
// Database-backed: bind your own registry…
$this->app->singleton(ServerRegistry::class, DatabaseServerRegistry::class);
// …or connect ad hoc without any registration:
Postal::connect(new ServerConfig(name: 'tenant-42', url: $url, key: $key))->send($message);
use Cbox\LaravelPostal\Facades\Postal;
$fake = Postal::fake();
// ... code that sends ...
$fake->assertSent(fn ($message, $server) => $server === 'cbox-billing');
bash
composer postal:install
php artisan migrate
bash
php artisan postal:doctor
bash
php artisan postal:webhook-key
# → POSTAL_WEBHOOK_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----\n..."
bash
php artisan postal:tail
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.