ESP32-powered alarm clock gets a comprehensive 2.0 upgrade

https://cdn-blog.adafruit.com/uploads/2026/12/esp32-powered-alarm-clock-gets-a-comprehensive-2-0-upgrade.jpg

ESP32-powered alarm clock gets a comprehensive 2.0 upgrade

Rouse is a bedside alarm clock. It’s built from a ready-made ESP32 touch display and a 3D-printed case. An updated version 2.0 is now out. The screen has four views: Clock, Radio, Weather and Carousel.

It streams internet radio stations. An alarm can wake someone to a station. A built-in sound plays as backup. The clock serves its own web page with a live picture of the screen and working Snooze, Stop and radio buttons.

A faint scratching sound came from the audio clock source. Switching clocks and upsampling the audio cleaned it up. The case files are unchanged. Existing builds can receive an update over WiFi.

See the video below and more on hackaday.io. Via Hackaday.

3D printing – Adafruit Industries – Makers, hackers, artists, designers and engineers!

I Built an MCP Server in Laravel So Claude Can Query My Database

https://res.cloudinary.com/dpwobw4um/image/upload/v1792476870/blogs/Laravel_MCP_database_query_safely_20261020091357.jpg

MCP Server Laravel: Letting Claude Query My Database Safely

I was tired of pasting database schemas and order numbers into Claude. Every support question meant copying context by hand before I got a useful answer. Then I built an MCP server in Laravel. It is a small part of my app that exposes safe, narrow tools Claude can call directly. This is my MCP server Laravel build diary, from install to locked-down production, over four days.

Quick Answer: MCP, the Model Context Protocol, is an open standard released openly by Anthropic in November 2024. It lets AI assistants discover and call tools your app exposes, instead of you pasting data into a chat. Laravel’s official laravel/mcp package, stable at 1.0 since mid-September 2026, scaffolds servers, tools, resources, and prompts with Artisan commands. I built a support server with one read-only database tool, scoped to the logged-in tenant. Claude asks for an order. The tool runs a scoped query. The answer returns in seconds.

Why I Started My MCP Server Laravel Build

Context: I support a dashboard for a distribution client in Riyadh. The same questions kept arriving: orders, invoices, shipment statuses.

Action: I built a small MCP server with read-only tools over the orders table. Then I connected it to my AI assistant. I was tired of pasting schemas and order numbers into Claude for every question.

Result: those questions now get answered in seconds from a chat window. But my first version also had a write tool for order notes. I removed it after a vague instruction nearly edited the wrong record.

Lesson: start read-only. Add write tools later, behind a human approval step. Experimenting with AI inside Laravel? Read my overview of what you can actually build with the Laravel AI SDK. It pairs well with this build.

What an MCP Server Actually Is

MCP stands for Model Context Protocol. A protocol is simply an agreed way for two programs to talk. Anthropic released MCP openly in November 2024. It is now the standard way to plug tools into AI assistants like Claude, ChatGPT, and coding agents.

Your app plays the server role. It advertises capabilities the assistant discovers. Then it serves calls over JSON-RPC, a plain message format for remote calls, usually over HTTP. For local CLIs like Claude Code, the stdio transport runs the server as a subprocess with no network involved.

You decide exactly which tools exist and what each may touch. Claude never gets raw database access. It gets one narrow door, and you hold the key. MCP has three building blocks. A tool runs an action and returns a result, like looking up one order. A resource exposes readable data the model can pull, like a returns policy document. A prompt is a reusable instruction template, like "summarise this ticket for a manager." Most Laravel builds need tools first.

Day 1: MCP Server Laravel Install and Scaffold

You need a Laravel 12 or 13 app with PHP 8.2 or newer, plus Composer. First I installed the official laravel/mcp package, stable at 1.0 since mid-September 2026. Artisan is Laravel’s built-in command-line tool, so these are plain terminal commands. Then I published the AI routes file and scaffolded my server:

composer require laravel/mcp, then php artisan vendor:publish --tag=ai-routes, then php artisan make:mcp-server SupportServer.

The publish step creates routes/ai.php. The scaffold creates app/Mcp/Servers/SupportServer.php with attributes for its name and version:

<?php

namespace App\Mcp\Servers;

use App\Mcp\Tools\LookupOrderTool;
use Laravel\Mcp\Server;
use Laravel\Mcp\Server\Attributes\Name;
use Laravel\Mcp\Server\Attributes\Version;

#[Name('Support Server')]
#[Version('1.0.0')]
class SupportServer extends Server
{
    // Tools, resources, and prompts each get their own
    // array. One server per area (support, billing) is
    // easier to permission than one giant server.
    protected array $tools = [
        LookupOrderTool::class,
    ];

    protected array $resources = [
        // ExampleResource::class,
    ];

    protected array $prompts = [
        // ExamplePrompt::class,
    ];
}

What I learned: scaffolding only registers the capability arrays. Nothing is callable yet, and that is expected. Tools come tomorrow.

Checkpoint: run php artisan route:list and confirm the ai.php-backed route group exists. Run php artisan about and confirm the server class loads without errors.

Tools are plain PHP classes. Each one declares a description, a handle method that runs, and a schema. A tenant is one client’s separate slice of the data, so tenant-scoped means the tool only sees that client’s rows. The schema is a JSON Schema that describes the input it accepts. I marked my database read with the read-only attribute, so even a hijacked call cannot change data.

<?php
namespace App\Mcp\Tools;
use App\Models\Order;
use Illuminate\JsonSchema\JsonSchema;
use Laravel\Mcp\Request;
use Laravel\Mcp\Response;
use Laravel\Mcp\Server\Attributes\IsReadOnly;
use Laravel\Mcp\Server\Tool;
#[IsReadOnly]
class LookupOrderTool extends Tool
{
    protected string $description = 'Look up one order by its number. Read-only.';
    public function handle(Request $request): Response
    {
        // Scope to the authenticated tenant. Never take a user
        // id from the model: the session is the source of
        // truth, the model is the guest.
        $order = Order::where('number', $request->get('number'))
            ->where('team_id', $request->user()->currentTeam()->id)->first();
        if (! $order) { return Response::text('No order found with that number.'); }
        return Response::text("Order {$order->number}: {$order->status}, total {$order->total} SAR.");
    }
    public function schema(JsonSchema $schema): array
    {
        return ['number' => $schema->string()
            ->description('The order number, e.g. ORD-1042.')->required()];
    }
}

What I learned: the tool knows nothing about the assistant. It only trusts the authenticated user on the request. The session is the source of truth, and the model is the guest. Before wiring tools into anything that spends money, read my guide. It covers how I automate complex business workflows with Next.js, Laravel, and AI agents.

Checkpoint: write a Pest or PHPUnit test. Call handle with a seeded order number. Assert the response contains that order number. Then assert that another tenant’s order number returns "No order found."

Day 3: Registering Routes and Testing with the Inspector

On day 3 I registered the server in routes/ai.php through the MCP registrar. Sanctum middleware guards it. Sanctum is Laravel’s token authentication package:

<?php

use App\Mcp\Servers\SupportServer;
use Laravel\Mcp\Facades\Mcp;

Mcp::web('/mcp', [SupportServer::class])->middleware(['auth:sanctum']);

Never expose an MCP server without authentication. In 1.0, every route registered this way also passes header validation middleware. Note that 1.0 ships the 2026-07-28 protocol revision. It brings stateless servers and stricter header checks. Older tutorials showing an initialize handshake describe the legacy flow.

Then I tested with the MCP Inspector. It is a test app that lists your tools and lets you call them by hand. I confirmed three things. The tool appears with its description. A valid order number returns the right row. A request without a token gets rejected.

What I learned: the Inspector catches auth mistakes in seconds. Testing by hand in Claude wastes time by comparison. The official laravel/mcp repository and the Laravel News 1.0 release notes are the sources I trust when the API moves. The official MCP documentation covers the protocol side in full.

Checkpoint: with no token, the endpoint must fail authentication. With a valid token, asking for order ORD-1042 must return that order and nothing else.

Day 4: Locking It Down

Day 4 was all security, no new features. I kept auth:sanctum on every MCP route. I scoped every query to the authenticated tenant, as in the Day 2 tool. Then I added logging: every tool call records the user id, the tool name, and the arguments. When something looks wrong later, that log is my paper trail.

I also planned for growth. When the tool list grows, I will enable the searchable tool catalog. Then the model discovers tools on demand instead of loading all of them at once. The write tool for order notes stays deleted. It only comes back behind a human approval step, and that is a firm rule now. My notes on how I use AI during development cover the same caution. Never hand an assistant a power you would not hand a stranger.

What I learned: security is a checklist, not a feeling. Auth, tenant scoping, read-only defaults, logging, and a catalog plan. That is the whole lockdown.

Checkpoint: the audit log shows one row per tool call with user id, tool name, and arguments. An unauthenticated request to /mcp still gets rejected.

Frequently Asked Questions

How do I build an MCP server in Laravel?

Install the official package with composer require laravel/mcp. Publish the AI routes with php artisan vendor:publish --tag=ai-routes. Then scaffold with php artisan make:mcp-server SupportServer. Add a read-only tool, register the route with Sanctum auth, and test with the MCP Inspector. The diary above walks each step with checkpoints.

What is an MCP server in simple terms?

It is a part of your app that exposes safe, narrow tools an AI assistant can call. Instead of pasting data into a chat, the assistant discovers your tools and calls them. Your code runs and returns the result. You decide exactly which tools exist and what each may touch.

Is it safe to let Claude query my database?

Only through narrow, read-only, tenant-scoped tools, behind authentication, with logging. Never expose raw SQL or a generic query tool: one vague instruction could read or change the wrong rows. The assistant gets tools, never credentials and never the database itself. My guide to building with the Laravel AI SDK covers the same caution from the app side.

Tools run actions and return results. Resources expose readable data the model can pull, like documents. Prompts are reusable instruction templates the user can invoke. Most Laravel builds need tools first, resources for reference documents, and prompts for repeated complex requests.

How does stdio transport work with Claude Code?

Stdio runs the server as a subprocess of the CLI tool, with no network involved. Claude Code starts your Laravel MCP server locally and talks to it over standard input and output. For hosted setups you use HTTP instead, with your registered route and an auth token.

Do I need authentication on my MCP server?

Yes, always. Never expose an MCP server without authentication. I guard every route with auth:sanctum, Laravel’s token auth. Every tool call scopes its query to the authenticated tenant. The MCP Inspector test above proves that a request without a token gets rejected.

Can I use MCP with models other than Claude?

Yes. MCP is a protocol, not a Claude feature. ChatGPT, Cursor, Claude Code, and others can all act as MCP clients. Your Laravel server does not care which assistant connects. It only needs the client to speak the protocol and pass your authentication.

What should I log in an MCP server?

Log every tool call with the user id, the tool name, and the arguments. That gives you a paper trail when something looks wrong. Log rejections too, like failed auth attempts. Review the log weekly, the same way you would review any security log.

Your First MCP Server Laravel Build Is Closer Than You Think

Your first MCP server Laravel project is mostly Laravel. You get Artisan scaffolding, the service container, validation-style schemas, and middleware for auth. Install and scaffold. Add a read-only tool scoped to the current tenant. Then register the route, test with the Inspector, and lock it down. Four days, one working tool, zero leaked data.

Keep your first server small. One tool that reads one table teaches you the whole pattern. You can add a second tool once the first one behaves. That is how I grew my support server. And every new tool gets the same treatment: narrow scope, a schema, a test, and a log line.

Want a second pair of eyes on your MCP design before it touches production data? Message me here.

One more habit worth copying. I keep a tiny runbook for my servers. It lists each tool, what data it touches, and who may call it. When a client asks "what can this thing do," I send the runbook. It takes ten minutes to write and saves hours of back and forth.

Laravel News Links

Ford unveils the GT41 as it hopes to win Le Mans again

https://cdn.arstechnica.net/wp-content/uploads/2026/11/Ford-GT41-and-GT40_06-1152×648.jpg

Sixty years ago, after two failed attempts, Ford won the 24 Hours of Le Mans with its GT40 race car. In the years since, the Blue Oval has been back to France more than a few times, with varying success. It could never replicate the GT40’s success winning overall, but it celebrated the 40th anniversary with a class win. Now it wants another shot at the really big trophy, and it debuted the car during the Detroit Lions-Chicago Bears football game today: meet the GT41.

“Revealing the Ford GT41 is a significant moment for everyone involved in this program,” said Dan Sayers, manager of Ford Racing’s Hypercar program. “It’s the result of an enormous amount of work across our engineering, design, and development teams and an important milestone on our journey towards 2027. We know the scale of the challenge ahead—the level of competition in Hypercar is incredibly high, and there are no shortcuts to success. Our focus has been on building the right foundations, bringing together the right people and making sure we learn as much as possible from every stage of development.”

The video was directed by Zack Snyder and features Matt Damon’s voice-over.

Like many other entrants in the World Endurance Championship’s Hypercar class, Ford has chosen the rear-wheel-drive LMDh technical approach rather than building the GT41 entirely from scratch, as Ferrari and Aston Martin do with their cars. LMDh cars start with one of four approved carbon fiber chassis—in this case, Ford is working with Oreca, which has also partnered with Genesis and Acura.

Read full article

Comments

Ars Technica

Anthropic Launches Claude Ship to Review, Fix, and Approve Code

Anthropic has unveiled Claude Ship, a new feature in Claude Code that allows AI agents to review pull requests, fix bugs, resolve merge conflicts and approve code changes according to policies established by development teams. 9to5Mac reports: Claude Ship is comprised of three agents: Code Review, PR Steward, and Claude Approvals. "Together, they take a pull request through review, fixes, and an approval decision so teams don’t have to manage each step manually," Anthropic says. "Developers can try Claude Ship on their own pull requests with the new /ship command in Claude Code," Anthropic says.


Read more of this story at Slashdot.

Slashdot

A Serverless AWS AppSync Events Broadcasting Driver for Laravel

https://opengraph.githubassets.com/70092b9337715852f5e8fc859bcc65456f92e594efce0331913610382476bb4d/hschimpf/laravel-appsync-events

Laravel AppSync Events

Broadcast Laravel events over AWS AppSync Event APIs — managed, serverless WebSocket fan-out — with a matching Laravel Echo 2 connector on the client. The package publishes events with SigV4-signed HTTP calls, authorizes connections and subscriptions through an AppSync Lambda authorizer that verifies HMAC tokens issued by your app, and ships the Echo connector as @hds-solutions/laravel-echo-appsync.

CI
Packagist Version
npm Version
License

Warning

This package is in beta. The API may change between releases — pin an exact version in composer.json/package.json and check the changelog before upgrading. Found a bug or rough edge? Report it on GitHub.

AWS AppSync Event APIs give you a managed WebSocket endpoint: AWS holds the sockets, routes published events to channel subscribers, and scales the fan-out for you. This package plugs that into Laravel’s broadcasting layer — ShouldBroadcast events, routes/channels.php authorization, Broadcast::channel() — so you get realtime delivery without running Reverb, Pusher, or any WebSocket server of your own.

Use it when you want Laravel-native broadcasting but can’t (or don’t want to) operate a WebSocket fleet. AppSync Events is billed per published event and per connection time — check the AWS pricing page for current numbers.

The community package 7amoood/laravel-appsync-broadcaster solves the same problem with a different shape: Cognito OAuth for auth, a Redis-backed worker, and a Pawl WebSocket client that keeps a persistent publish connection; it ships no Echo connector. This package instead:

  • publishes over HTTP with SigV4/IAM — a stateless POST /event, no persistent publisher socket, no worker;
  • authorizes connections/subscriptions with a Lambda authorizer that verifies HMAC tokens your app issues (no Cognito, no Redis);
  • ships an Echo 2 connector so the frontend stays echo.private('orders.1').listen(...).
flowchart LR
    subgraph Laravel
        E["Event (ShouldBroadcast)"] --> B["AppSyncBroadcaster (SigV4)"]
        R["/broadcasting/auth"] --> TS["TokenSigner (HMAC secret)"]
    end
    subgraph AWS
        B -- "POST /event (IAM)" --> A["AppSync Event API"]
        A -- "EVENT_CONNECT / EVENT_SUBSCRIBE" --> L["Lambda authorizer"]
        L -. "verifies" .- TS
        A -- "WebSocket" --> C["Echo connector"]
    end
    C -. "{socket_id, channel_name}" .-> R
    R -. "{auth: subscribeToken}" .-> C
    TS -. "clientConfig: connectToken" .-> C



Loading


  1. A ShouldBroadcast event fires; AppSyncBroadcaster SigV4-signs a POST /event to the Event API’s HTTP endpoint with IAM credentials.
  2. AppSync delivers the event to every client subscribed to the mapped channel path (/private/orders/1 for private-orders.1).
  3. The browser connects with a connect token (from AppSyncEvents::clientConfig()) and asks your app for a per-channel subscribe token via POST /broadcasting/auth — the standard Echo channel-auth flow.
  4. AppSync calls your Lambda authorizer for EVENT_CONNECT and EVENT_SUBSCRIBE; AppSyncAuthorizer verifies the token’s HMAC signature, purpose and channel.
  5. EVENT_PUBLISH is always denied — clients can never publish; publishing is a server-side, IAM-only operation.
Component Version
PHP ^8.2
Laravel / Illuminate ^11.0 | ^12.0 | ^13.0
laravel-echo (peer) ^2.0
Node.js (build & test the js/ package) >= 22 — the published package runs in browsers
AWS An AppSync Event API (not a GraphQL API) — see AWS setup
composer require hds-solutions/laravel-appsync-events
php artisan appsync-events:install      # publishes config, adds .env placeholders
php artisan appsync-events:secret       # generates APPSYNC_CHANNEL_SIGNING_SECRET

npm install laravel-echo @hds-solutions/laravel-echo-appsync

Then set the environment values (the install command adds the placeholders to .env.example):

BROADCAST_CONNECTION=appsync

APPSYNC_HTTP_ENDPOINT=https://<id>.appsync-api.<region>.amazonaws.com/event
APPSYNC_REALTIME_ENDPOINT=wss://<id>.appsync-realtime-api.<region>.amazonaws.com/event/realtime
APPSYNC_CHANNEL_SIGNING_SECRET=<64 hex chars from appsync-events:secret>

appsync-events:secret --show prints a secret without touching .env; --force overwrites an existing one. The same secret must be deployed to the Lambda authorizer — it is never sent to AWS or to clients.

1. Authorize the channel — routes/channels.php:

use App\Models\User;
use Illuminate\Support\Facades\Broadcast;

Broadcast::channel('orders.{id}', function (User $user, int $id) {
    return $user->can('view-order', $id);
});

2. Broadcast an event:

use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;

class OrderShipped implements ShouldBroadcast
{
    public function __construct(public readonly int $orderId) {}

    public function broadcastOn(): array
    {
        return [new PrivateChannel('orders.'.$this->orderId)];
    }
}

3. Listen in the frontend:

import Echo from 'laravel-echo';
import { appSyncEchoOptions } from '@hds-solutions/laravel-echo-appsync';

const echo = new Echo(appSyncEchoOptions({
    wsEndpoint: 'wss://<id>.appsync-realtime-api.<region>.amazonaws.com/event/realtime',
    connectToken: () => fetchConnectToken(), // re-evaluated on every (re)connect
}));

echo.private('orders.1').listen('.OrderShipped', (e: unknown) => {
    console.log(e);
});

The Laravel channel name private-orders.1 (Echo adds private-) maps to the AppSync channel path /private/orders/1 — so a private channel namespace must exist on the Event API.

Before the driver works, AWS needs:

  • an Event API with auth providers AWS_LAMBDA + AWS_IAM (plus API_KEY only if you use public channels), connection mode AWS_LAMBDA, default publish mode AWS_IAM, default subscribe mode AWS_LAMBDA;
  • the public and private channel namespaces (or your configured names) — AppSync namespaces are the authorization boundary, so the private namespace subscribes via your Lambda authorizer while public may also allow API_KEY;
  • a Lambda authorizer holding the same APPSYNC_CHANNEL_SIGNING_SECRET, with a lambda:InvokeFunction resource policy for appsync.amazonaws.com scoped to the API ARN;
  • an IAM policy granting your app’s role appsync:EventPublish on arn:aws:appsync:<region>:<account>:apis/<api-id>/channelNamespace/<namespace>.

Full walkthrough plus CloudFormation, Serverless Framework, Terraform and CDK examples: docs/aws-setup.md.

AppSync Events offers five authorization types; this package uses three of them:

Type Used for Supported
AWS_IAM Your app publishing events (SigV4 POST /event) Yes — required
AWS_LAMBDA Clients connecting and subscribing to private channels, with Laravel’s Broadcast::channel() callbacks deciding access Yes — required for private channels
API_KEY Anonymous, read-only public channels Yes — optional
OPENID_CONNECT Clients authenticating with an OIDC provider No
AMAZON_COGNITO_USER_POOLS Clients authenticating with Cognito No

The package is PHP-strict: your Laravel users and routes/channels.php stay the source of truth, so Cognito and OIDC client authentication are out of scope. AppSync lets you set the authorization mode per namespace, so public channels (API_KEY) and private channels (AWS_LAMBDA) can live side by side on the same Event API.

Your Laravel app is not tied to a particular host. The broadcaster signs publish requests with the AWS SDK’s default credential chain (environment variables, web identity, ECS task role, EC2 instance profile), so wherever your app runs with an IAM role, it should need no keys in config — the role only needs appsync:EventPublish. /broadcasting/auth needs no AWS access.

Note

The platform notes below come from the platform documentation and the SDK’s credential chain; they have not been tested on a real Laravel Vapor or ECS deployment. Please verify them in your environment.

  • Laravel Vapor — per Vapor’s docs, your app’s Lambda runs under the laravel-vapor-role role and reserves the AWS_* credential and region variables. You will likely need to add appsync:EventPublish to that role; Vapor manages it itself, so see Laravel’s Customize Default Role post before editing it. Don’t set AWS_* keys yourself; APPSYNC_REGION can override the region.
  • Docker / ECS — grant the permission to the task role instead of configuring keys.

The authorizer below is the one piece AppSync invokes directly, so it must run on Lambda. As far as we know Vapor only deploys your Laravel app’s own functions, so plan to deploy the authorizer with another tool (Serverless Framework with Bref, CloudFormation, Terraform or CDK — see docs/aws-setup.md); it only needs the same APPSYNC_CHANNEL_SIGNING_SECRET.

AppSyncAuthorizer::authorize(array $event): array (HDSSolutions\Laravel\AppSyncEvents\Lambda) verifies the authorizer event and returns the AppSync contract {isAuthorized, ttlOverride, handlerContext?}:

  • EVENT_CONNECT → verified, unexpired token with purpose: connect.
  • EVENT_SUBSCRIBE → verified, unexpired purpose: subscribe token whose channel claim equals requestContext.channel.
  • EVENT_PUBLISH (and anything else) → always denied.

The class is framework-agnostic — constructor-injected secret, no container access — so it runs under any PHP Lambda runtime.

<?php

use HDSSolutions\Laravel\AppSyncEvents\Lambda\AppSyncAuthorizer;

return function (array $event): array {
    return (new AppSyncAuthorizer(
        $_ENV['APPSYNC_CHANNEL_SIGNING_SECRET'] ?? '',
        (int) ($_ENV['APPSYNC_AUTHORIZER_CACHE_TTL'] ?? 300),
        $_ENV['APPSYNC_CHANNEL_PREVIOUS_SIGNING_SECRETS'] ?? '',
    ))->authorize($event);
};

Bref is one way to run PHP on Lambda — it is not a dependency of this package. With Bref 3, an event handler implements Bref\Event\Handler (see Bref function handlers):

<?php

namespace App\Lambda;

use Bref\Context\Context;
use Bref\Event\Handler;
use HDSSolutions\Laravel\AppSyncEvents\Lambda\AppSyncAuthorizer;

final class AppsyncEventsAuthorizer implements Handler
{
    public function handle($event, Context $context): array
    {
        // If the function boots your Laravel app (e.g. bref/laravel-bridge),
        // resolve from the container instead: app(AppSyncAuthorizer::class)
        return (new AppSyncAuthorizer(
            $_ENV['APPSYNC_CHANNEL_SIGNING_SECRET'] ?? '',
            previousSecrets: $_ENV['APPSYNC_CHANNEL_PREVIOUS_SIGNING_SECRETS'] ?? '',
        ))->authorize($event);
    }
}
functions:
    authorizer:
        handler: App\Lambda\AppsyncEventsAuthorizer
        runtime: php-82
        environment:
            APPSYNC_CHANNEL_SIGNING_SECRET: ${ssm:/my-app/appsync-signing-secret}
            # The authorizer must never broadcast itself — see warning below.
            BROADCAST_CONNECTION: log
            APPSYNC_HTTP_ENDPOINT: ''
            APPSYNC_REALTIME_ENDPOINT: ''

Warning — no self-invocation. The authorizer Lambda must never broadcast: if it boots your application, force BROADCAST_CONNECTION=log (or null) and leave the AppSync endpoint env vars empty. A function that publishes to the API it authorizes can invoke itself recursively.

config/appsync-events.php (publish with php artisan vendor:publish --tag=appsync-events-config):

Key Env var Default Description
http_endpoint APPSYNC_HTTP_ENDPOINT — Event API HTTP endpoint the broadcaster POSTs to. Required.
realtime_endpoint APPSYNC_REALTIME_ENDPOINT — WebSocket endpoint handed to the JS connector. Required for clientConfig().
signing_secret APPSYNC_CHANNEL_SIGNING_SECRET — HMAC secret shared with the Lambda authorizer. Required.
previous_signing_secrets APPSYNC_CHANNEL_PREVIOUS_SIGNING_SECRETS — Comma-separated previous secrets still accepted for verification during rotation; never used for signing. Optional.
region APPSYNC_REGION → AWS_DEFAULT_REGION us-east-1 SigV4 region fallback when it can’t be parsed from http_endpoint.
namespaces.public APPSYNC_PUBLIC_NAMESPACE public AppSync namespace public channel names map onto; must exist on the Event API.
namespaces.private APPSYNC_PRIVATE_NAMESPACE private AppSync namespace private- channel names map onto; must exist on the Event API.
tokens.connect_ttl — 43200 Connect token lifetime, seconds (12 h).
tokens.subscribe_ttl — 3600 Subscribe token lifetime, seconds (1 h).
authorizer.cache_ttl — 300 ttlOverride the authorizer returns for authorized calls.
http.timeout — 2.0 Publish request timeout, seconds.
http.connect_timeout — 1.0 Publish connect timeout, seconds.
uid_resolver — null Invokable class-string to derive the uid token claim; null = getAuthIdentifier().
client.auth_endpoint — /broadcasting/auth Where the connector requests channel authorization.
client.inactivity_timeout APPSYNC_INACTIVITY_TIMEOUT 10 Seconds; shipped in clientConfig() for your client code to consume (see Vue composable).
routes.auth.enabled — true Registers /broadcasting/auth via Broadcast::routes() (never shadows your own route).
routes.auth.middleware — ['web'] Middleware on the auth endpoint.
routes.client_config.enabled — false Opt-in JSON endpoint serving the connector config.
routes.client_config.uri — broadcasting/appsync URI of the client-config endpoint.
routes.client_config.middleware — ['web', 'auth'] Middleware on the client-config endpoint.

The appsync broadcasting connection merges over the package config, so config/broadcasting.php may override http_endpoint, signing_secret, previous_signing_secrets, region, namespaces and http.* per connection. A connection that sets its own signing_secret must also set its own previous_signing_secrets — the package-level previous list is never carried onto a different primary secret:

'connections' => [
    'appsync' => [
        'driver' => 'appsync',
        // 'http_endpoint' => env('APPSYNC_HTTP_ENDPOINT'), // optional override
    ],
],
Method Returns
AppSyncEvents::clientConfig(?Authenticatable $user = null) Connector options {wsEndpoint, httpHost, connectToken, authEndpoint, publicNamespace, privateNamespace, inactivityTimeout} — null for guests. The connectToken is a static string minted once.
AppSyncEvents::uid($user) The uid claim for tokens: runtime closure → uid_resolver class → getAuthIdentifier().
AppSyncEvents::resolveUidUsing(Closure) Set the uid strategy at runtime (config is not a place for closures).
AppSyncEvents::signer() The TokenSigner bound to signing_secret (connectToken(), subscribeToken()).
AppSyncEvents::httpHost($endpoint) The host[:port] authority the handshake authorizes.

Share the client config as a prop — App/Http/Middleware/HandleInertiaRequests.php:

public function share(Request $request): array
{
    return [
        ...parent::share($request),
        'appSync' => AppSyncEvents::clientConfig($request->user()),
    ];
}
const echo = new Echo(appSyncEchoOptions(props.appSync));

props.appSync is already the exact AppSyncConnectorOptions shape — spread or pass directly. Its connectToken is a static string; if your sessions outlive tokens.connect_ttl, wrap it in a re-fetching function (see the SPA variant below).

Enable the client-config route and protect it with your API middleware:

'routes' => [
    'client_config' => [
        'enabled' => true,
        'middleware' => ['auth:sanctum'],
    ],
],
const config = await fetch('/broadcasting/appsync', { credentials: 'include' })
    .then((r) => r.json());

const echo = new Echo(appSyncEchoOptions({
    ...config,
    credentials: 'include',          // cookies on the channel-auth POST too
    connectToken: () => fetch('/broadcasting/appsync', { credentials: 'include' })
        .then((r) => r.json())
        .then((c) => c.connectToken), // fresh token on every (re)connect
}));

Cross-origin apps need Access-Control-Allow-Credentials on both endpoints — configure Laravel’s config/cors.php accordingly.

For web-guarded auth endpoints, send the CSRF token on the channel-auth POST:

appSyncEchoOptions({
    // ...
    auth: {
        headers: { 'X-CSRF-TOKEN': csrfToken },
    },
})

Or use bearerToken for Sanctum token auth instead.

Visibility-aware Echo (Vue 3)

clientConfig().inactivityTimeout is a hint your code consumes — the connector itself doesn’t time out idle tabs. This composable disconnects a hidden tab after inactivityTimeout seconds and reconnects on return:

import Echo from 'laravel-echo';
import { appSyncEchoOptions } from '@hds-solutions/laravel-echo-appsync';
import type { AppSyncConnectorOptions } from '@hds-solutions/laravel-echo-appsync';
import { onBeforeUnmount, onMounted, readonly, ref } from 'vue';

export function useAppSyncEcho(options: AppSyncConnectorOptions, inactivityTimeout = 10) {
    const echo = new Echo(appSyncEchoOptions(options));
    const connected = ref(false);
    let timer: ReturnType<typeof setTimeout> | undefined;

    const connect = () => {
        clearTimeout(timer);
        echo.connector.connect();
        connected.value = true;
    };

    const disconnect = () => {
        clearTimeout(timer);
        echo.disconnect();
        connected.value = false;
    };

    const onVisibilityChange = () => {
        if (document.visibilityState === 'visible') connect();
        else timer = setTimeout(disconnect, inactivityTimeout * 1000);
    };

    onMounted(() => {
        document.addEventListener('visibilitychange', onVisibilityChange);
        connect();
    });

    onBeforeUnmount(() => {
        document.removeEventListener('visibilitychange', onVisibilityChange);
        disconnect();
    });

    return { echo, connected: readonly(connected), connect, disconnect };
}

For anonymous, read-only channels, add API_KEY to the Event API’s connection and subscribe auth modes and pass the key to the connector — no connect token or auth endpoint round-trip:

new Echo(appSyncEchoOptions({
    wsEndpoint: 'wss://<id>.appsync-realtime-api.<region>.amazonaws.com/event/realtime',
    publicApiKey: 'da2-xxxxxxxxxxxxxxxxxxxxxxxxxx',
}));

broadcast(new OrderShipped($order))->toOthers() is supported: the sender’s socket id (the X-Socket-ID header Echo attaches to the request that triggered the broadcast) is lifted out of the event data into a socket field on the published event envelope, and the Echo connector drops any event whose envelope socket matches its own socketId().

This is client-side filtering — AppSync has no server-side sender exclusion, so other connectors or raw subscribers still receive the event.

Channel names and AppSync channel paths

Laravel channel names map to AppSync channel paths /{namespace}/{segment}[/{segment}…] — the mapping is identical in PHP (ChannelPath) and TS (toAppSyncChannel), verified against a shared fixture:

Laravel channel name AppSync channel path
orders /public/orders
orders.1 /public/orders/1
orders.1.items /public/orders/1/items
orders.1-items /public/orders/1-items
private-orders.1 /private/orders/1
private-private.abc /private/private/abc
private-orders.1.items /private/orders/1/items
private-orders.550e8400-e29b-41d4-a716-446655440000 /private/orders/550e8400-e29b-41d4-a716-446655440000
private-solo /private/solo
privateer.x /public/privateer/x

Rules:

  • The private- prefix selects the private namespace (namespaces.private, default private); everything else maps under the public namespace (namespaces.public, default public). Prefixes are exact — privateer.x is public.
  • private-encrypted- names are rejected (InvalidArgumentException / InvalidChannelNameError) — payload encryption is not implemented by this package; use private-.
  • presence- names are rejected (InvalidArgumentException / InvalidChannelNameError) — presence channels are out of scope.
  • Each dot-part of the remaining name becomes a path segment (at most 4 — AppSync paths are capped at 5 segments total including the namespace).
  • - stays literal inside segments, so orders.1.items and orders.1-items are different channels (subscribe tokens are scoped to the path — keep that in mind when picking names).
  • Namespace names are configurable (namespaces.public / namespaces.private) but are the AppSync authorization boundary — they must match the namespaces created on the Event API, and each namespace can carry its own auth mode (e.g. API_KEY + Lambda for public, Lambda authorizer for private).
  • Subscribing or publishing to a missing namespace fails (subscribe_error / 404 BroadcastException).
  • Each segment is 1–50 chars, alphanumeric at both ends with [A-Za-z0-9-] inside — underscores are not allowed in AppSync channel paths. Invalid names throw InvalidArgumentException (PHP) / InvalidChannelNameError (JS) instead of hitting the API.
  • Token wire format — base64url(json(claims)) + '.' + hex(hmac_sha256(payload, secret)). Claims: purpose (connect/subscribe), uid, exp (unix), and channel (the AppSync path) on subscribe tokens. The secret is shared only between your app and the authorizer — never sent to AWS or clients.

  • TTLs — tokens.connect_ttl (default 12 h) and tokens.subscribe_ttl (1 h). authorizer.cache_ttl is the ttlOverride returned on authorized calls — how long AppSync may cache the decision.

  • Publish is never client-authorized — EVENT_PUBLISH is denied unconditionally; publishing requires IAM appsync:EventPublish.

  • Secret hygiene — keep APPSYNC_CHANNEL_SIGNING_SECRET out of VCS (use SSM/Secrets Manager for the Lambda side). Rotate without downtime:

    1. Generate a new secret — php artisan appsync-events:secret --show prints 64 hex chars without touching .env (or openssl rand -hex 32).
    2. Deploy the authorizer first with APPSYNC_CHANNEL_SIGNING_SECRET=<new> and APPSYNC_CHANNEL_PREVIOUS_SIGNING_SECRETS=<old> — it now verifies both.
    3. Deploy the Laravel app with the new APPSYNC_CHANNEL_SIGNING_SECRET — it signs new tokens immediately; clients receive them on their next auth/clientConfig call.
    4. Once the longest token TTL has elapsed — connect tokens default to 12 h (tokens.connect_ttl), subscribe tokens to 1 h (tokens.subscribe_ttl) — remove APPSYNC_CHANNEL_PREVIOUS_SIGNING_SECRETS from the authorizer.

    Clients holding tokens signed with the old secret simply reconnect and re-authorize with fresh tokens; already-authorized sockets are unaffected.

  • Least privilege — scope appsync:EventPublish to the namespaces you use, and the authorizer’s SourceArn to the API.

  • Testing — the AWS emulator used by the test suite does not verify SigV4 signatures, does not invoke Lambda authorizers, and does not validate token contents; those paths are covered by unit tests. Do not use the emulator for security testing.

Keep BROADCAST_CONNECTION=reverb (or log) locally and appsync in production — broadcasting is driver-agnostic, so nothing else changes. For AppSync-specific behavior, the repo runs against the AWS emulator: tests/emulator/start.sh, then composer test:emulator / npm --prefix js run test:emulator.

composer test          # Pest (unit + feature)
composer lint          # Pint
composer analyse       # PHPStan
npm --prefix js test   # Vitest

Emulator tests, fixture conventions and the PR checklist live in CONTRIBUTING.md; security reports go through SECURITY.md.

  • No presence channels — echo.join() / presenceChannel() throws, and channel names starting with presence- are rejected (InvalidArgumentException / InvalidChannelNameError); presence metadata has no AppSync Events equivalent.
  • No client events / whispers — clients cannot publish by design.
  • One Echo connector instance per socket — the connector multiplexes channels over a single AppSync WebSocket; concurrent reconnects reuse the latest connect generation only.
  • Emulator caveats — see tests/emulator/README.md.

Both packages follow SemVer and release in lockstep (0.x while the API surface stabilizes). MIT — see LICENSE. Built by Hermann D. Schimpf.

Laravel News Links

pgjumbo: A PostgreSQL Client for macOS, Windows, and Linux

https://laravelnews.s3.amazonaws.com/featured-images/pgjumbo-featured.png

pgjumbo is a new PostgreSQL client from Benjamin Ibrulj, for macOS, Windows, and Linux. Before an update, delete, or a table change runs, it tells you how many rows it will touch, which triggers fire, which foreign keys cascade, and what it will lock.

Writes Show What They Will Touch

Rest the cursor on a write in the Query Tool and a strip appears above it. The row count comes from the planner’s estimate, so nothing runs to produce it. If the estimate isn’t good enough, Count exactly runs a read-only count(*) built from the statement’s WHERE clause, for up to 10 seconds:

Rehearse runs the UPDATE, DELETE, or MERGE inside an uncommitted transaction and lists every row it changed, with old and new values side by side.

Each statement also runs under its own savepoint, so a typo halfway through a transaction undoes that one statement and leaves the earlier ones in place. A Smart commit mode waits for your first write before it opens a transaction, so a session that only reads never holds one open.

Query Plans and What If

The Explain tab draws the plan as a diagram, ties each step to the SQL it came from, and marks the slowest step:

What if compares the current plan with the plan you’d get from an index that doesn’t exist yet, or from a different planner setting like work_mem. Both plans come from a plain EXPLAIN in the tab’s session, so nothing is built and nothing changes for other connections on the server.

The Assistant

The optional Assistant runs the Claude Code installation already on your computer, signed in to your own Claude plan or API key. pgjumbo has no Claude account of its own. It’s off by default, and when it’s off, pgjumbo sends nothing anywhere.

You decide what it may read on each kind of server. By default, it reads structure and statistics, asks before reading row data on Dev and Staging, and asks every time on Production. SQL it suggests is checked with PostgreSQL’s parser, and nothing runs until you run it.

Learn More

Pgjumbo connects to PostgreSQL 14 through 19 (12 and 13 on a best-effort basis), Amazon RDS and Aurora with IAM sign-in, and servers behind an SSH tunnel.

Downloads are available for macOS 13 or newer (one build for Apple silicon and Intel), Windows 10 and 11 on x64 and ARM64, and Linux.

You can download pgjumbo and read the user guide at pgjumbo.com.

Laravel News

T-Rex Arms Data Dump: Thousands Of Free Military Manuals

https://cdn-fastly.thefirearmblog.com/syndication-media/2026/11/12/10351/rex-arms-data-dump-thousands-of-free-military-manuals.jpg

Finally, you can get a manual to field-strip your old mil-surp rifle. [Zac K.]

Not many things in this world will come for free, but here is one thing that comes with no price tag—sort of. T-Rex Arms has just made a massive upload of military manuals to their website; they’re spreading the word that you can visit their page and download all these books and publications at no cost.

Mil-surp madness @ TFB:

Reading to save your life

If you’ve ever been in the armed forces, or even in an army-navy store, you know what a military manual is. Everything in the military comes with a how-to guide. Every piece of equipment and every practice. At least, that’s how it works in the U.S. military and other standardized armed forces.

United States Army Lt. Gen. John Kimmons wants you to pull off Gitmo interrogation correctly. [US Army]

Careful organization breeds competence and the military will tell you how to do everything in a way to its satisfaction. Whether that’s lacing your boots or packing a parachute or surviving a snake-infested jungle in Laos, there’s a way that Uncle Sam wants you to do it, and a manual will tell you how.

No matter what part of Army life you’re talking about, there’s a manual for it. Army surplus stores typically sell reprints of the most popular titles. [Zac K.]

This means the military has all sorts of firearms-related manuals. Whether it’s marksmanship skills, firearms maintenance or other gun stuff, the military has printed information on its best practices, and T-Rex Arms has many of those available for you for free.

Check their full list of manuals here. Much of the information covered will be of zero use to anyone, but some of it will be quite useful from a historical perspective, if nothing else.

Even opposing forces’ small arms are sometimes covered in these manuals. [Zac K.]

Of course, many manuals from the list were already available elsewhere for free if you knew where to look, but having T-Rex put the whole list in a single place makes for convenient one-stop shopping. If you want to put your AI subscription to good use, have it make an installer tool that lets you download all the files at once … if you’ve got the hard drive space.

The Firearm Blog

Using dbvr with MySQL: From First Datasource to Production Queries

 

What dbvr is, and why use it with MySQL

dbvr lets you define MySQL connections and run SQL from the command line, with no graphical interface. That makes it a fit for servers, containers, and pipelines where a desktop database tool cannot run.

DBeaver Corporation announced dbvr on March 26, 2026 as a standalone CLI built on the same multi-database engine as the DBeaver desktop products. According to that announcement, it can:

  • Run SQL queries and scripts from saved or inline connection settings, with no interactive login.
  • Run on locked-down servers, inside containers, and over SSH on remote hosts.
  • Authenticate natively to AWS, GCP, and Azure databases.
  • Export query results to S3, Google Cloud, or Azure storage.
  • Plug into CI/CD pipelines for database checks and backup/restore validation.

There are two editions. The commercial edition is an annual per-machine subscription with a 14-day trial. dbvr Community is free under the Apache License 2.0. Per the dbeaver.io product summary, Community covers MySQL, username and password authentication, SSH tunnels, local result export, and metadata management. Cloud storage export, cloud authentication, external secret managers, and the MCP server are listed for the commercial edition only.

This post covers creating a MySQL datasource, running queries, and using dbvr for production queries. Full documentation is available.

Creating a MySQL datasource

In dbvr, a datasource is a saved, named connection, so later commands can refer to it by name instead of repeating host and credentials. You create one with the datasource create command and a MySQL driver.  In the following example we are using 26.10.0 MySQL Community Server – GPL.

The full option list is in the datasource create reference.

$ dbvr datasource create –driver=mysql8 –name=world –host=localhost –port=3306 –user=stoker –password=hidave –database=world
mysql8-1a1f537d8af-5a9a876cc3457ae9
$ dbvr datasource list
ID                                           NAME        DRIVER      mysql8-1a1f537d8af-5a9a876cc3457ae9          world       mysql8

Running queries

The sql command runs a query or a whole script against a datasource and prints or exports the results. Per the sql reference and cheat sheet, you can:

  • Pass a query inline, pointing at a saved datasource by name.
  • Run a .sql script file instead of an inline query.
  • Skip the saved datasource and give connection details inline, useful for one-off checks.
  • Write results to a file in a chosen format such as CSV.

The meta commands list databases, schemas, and tables and print their DDL, so you can inspect a MySQL server without a GUI. In MySQL, a schema and a database are the same thing, so expect the database and schema listings to overlap.

$ dbvr sql -ds=world "SELECT * FROM city LIMIT 5;"
|ID |Name          |CountryCode|District     |Population|
|—|————–|———–|————-|———-|
|1  |Kabul         |AFG        |Kabol        |1,780,000 |
|2  |Qandahar      |AFG        |Qandahar     |237,500   |
|3  |Herat         |AFG        |Herat        |186,800   |
|4  |Mazar-e-Sharif|AFG        |Balkh        |127,800   |
|5  |Amsterdam     |NLD        |Noord-Holland|731,200   |
Rows read: 5, (153ms)

Using dbvr for production queries

Because dbvr needs no GUI or interactive login, it can run production MySQL queries wherever your automation already runs: a scheduled job on a server, a container, or a CI/CD pipeline step.

Common production uses, based on DBeaver’s announcement and docs:

  • Scheduled reports. A cron job or scheduler runs a saved .sql script against the production datasource and exports the results to CSV.
  • Exports to cloud storage. The sql command can read scripts from and write results to S3, Google Cloud, or Azure storage URIs (commercial edition).
  • Pipeline checks. A deployment step runs validation queries, such as row counts or schema checks, and fails the build if they return unexpected results.
  • Backup and restore validation. Verification scripts run against a restored database to confirm schema integrity and data completeness.
  • AI tool access. dbvr can run as an MCP server (mcp start, commercial edition) so an AI assistant can query a datasource. For production, point it only at a read-only datasource.

To keep this safe:

  • Keep Prod in its own project. Separate projects make it harder to run a test script against production by mistake.  
  • Keep passwords off the command line. A password typed as a command option can end up in shell history and process lists. dbvr has secret-manager commands and a pre-configure credentials guide; check those for the method that fits your setup.
  • Use a read-only MySQL account. Grant it only SELECT on the databases reports need. This protects data regardless of how dbvr is configured.
  • Cap runaway queries. MySQL’s max_execution_time setting (in milliseconds) stops long-running SELECT statements. It applies to read-only SELECTs, not writes, and is set globally or per session rather than per account.
  • Version-control your scripts. Run reviewed .sql files from a repository rather than ad-hoc inline queries.

dbvr vs. the mysql client

Neither tool wins everywhere. The mysql command-line client is the more mature choice for MySQL-only work, while dbvr pays off when you need multiple databases, cloud logins, or cloud exports. The dbvr column reflects DBeaver’s own published claims, not independent testing.

dbvr

mysql client

Databases

100+ SQL and NoSQL engines

MySQL (and largely MariaDB) only

Cost

Annual per-machine subscription; free Community edition (Apache 2.0)

Free; ships with MySQL

Cloud authentication

Native AWS, GCP, and Azure (commercial edition)

Usually needs a token from the cloud provider’s CLI

Exporting results

Writes directly to S3, Google Cloud, or Azure storage (commercial edition)

Writes local output; upload separately

Saved connections

Named datasources grouped in projects, plus secret-manager

Option files (~/.my.cnf) and mysql_config_editor login paths

AI tool access

Built-in MCP server (commercial edition)

None built in

MySQL-specific features

Not verified to match the mysql client

\G vertical output, SOURCE, --safe-updates, batch mode

Maturity

Launched March 2026

Decades of production use

Pick the mysql client for MySQL-only work on servers you control. Pick dbvr when you work across several database engines, use cloud-managed databases with IAM-style login, or export straight to cloud storage. Oracle’s MySQL Shell (mysqlsh) is a third option worth evaluating if you also want scripting in JavaScript or Python.

Wrapping up

dbvr brings DBeaver’s MySQL connectivity to the command line: create a datasource once, then run and export queries from scripts, servers, and pipelines. Pair it with separate projects, stored credentials, and a read-only MySQL account, and it becomes a dependable way to run production queries.

Sources

Planet for the MySQL Community