1
Install the package
2
Configure a Server send token
https://pushctl.com and the default timeout is 10 seconds.3
Create a Laravel notification
4
Route the recipient
5
Dispatch through Laravel
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Install and configure the Pushctl Laravel SDK and send your first notification.
Install the package
composer require pushctl/pushctl-laravel
Configure a Server send token
PUSHCTL_TOKEN=push_live_your_server_token
https://pushctl.com and the default timeout is 10 seconds.Create a Laravel notification
use Illuminate\Notifications\Notification;
use Pushctl\PushctlLaravel\Channels\PushctlChannel;
use Pushctl\PushctlLaravel\Messages\PushctlMessage;
final class OrderReady extends Notification
{
public function __construct(private readonly Order $order) {}
public function via(object $notifiable): array
{
return [PushctlChannel::class];
}
public function toPushctl(object $notifiable): PushctlMessage
{
return PushctlMessage::create(
'Order ready',
'Your order is ready for collection.',
)->actionUrl("myapp://orders/{$this->order->id}");
}
}
Route the recipient
use Illuminate\Notifications\Notification;
public function routeNotificationForPushctl(Notification $notification): string|array
{
return $this->pushctl_user_id;
}
Dispatch through Laravel
$user->notify(new OrderReady($order));
PUSHCTL_TOKEN in the server environment. Do not commit it or expose it to browser or mobile code.Was this page helpful?