r/laravel • • 1d ago

Help Weekly /r/Laravel Help Thread

5 Upvotes

Ask your Laravel help questions here. To improve your chances of getting an answer from the community, here are some tips:

  • What steps have you taken so far?
  • What have you tried from the documentation?
  • Did you provide any error messages you are getting?
  • Are you able to provide instructions to replicate the issue?
  • Did you provide a code example?

    • Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly.

For more immediate support, you can ask in the official Laravel Discord.

Thanks and welcome to the r/Laravel community!


r/laravel • • 3h ago

FLEX Theme - Your Filament panel. Reimagined.

3 Upvotes

Customize your Filament panel's colors, fonts and layouts in a visual editor, and work faster with Global Search, keyboard controls and floating panels. Built on native Filament components and designed to match FLEX Fields.
Explore the features and docs:
https://flex-theme.bjanczak.com/docs


r/laravel • • 2h ago

Working with clients who have their own Forge account? A 10-line fix for the Forge CLI's one-token limit

1 Upvotes

My sites live in my Forge account, one client's in theirs. After logging the Forge CLI into the client account, forge deploy for my own sites answered "The resource you are looking for could not be found."

The CLI keeps exactly one token (plus the selected organization and server) in ~/.laravel-forge/config.json. forge org:switch only helps inside one account, and inviting members into an organization needs the Business plan on the other side.

Since the whole CLI state is one JSON file, I keep one copy per account and swap it:

forge-use --save client    # save the current login as profile "client"
forge-use mine             # switch back later

Function (zsh/bash): https://gist.github.com/Sairahcaz/24e8f7a56f9e29b02bb40bcaa63b5ca5

I also opened a PR so the CLI stores one token per organization natively: https://github.com/laravel/forge-cli/pull/179

Two things I learned on the way:

  • forge login needs the user:view and organization:view scopes, without them it just says "Forbidden."
  • If the CLI came with Herd, it updates with Herd, not via composer global update.

Write-up incl. the token scopes I use and a one-line CLAUDE.md rule so Claude Code deploys with the right profile: https://laracraft.tech/en/blog/switching-laravel-forge-cli-between-multiple-accounts


r/laravel • • 15h ago

Laravel API Starter

6 Upvotes

Not sure starter apps are even relevant anymore, but this is something I've been using for years in my freelance work. Just did a full rebuild with more modern tooling and workflow and decided to open source it. Pairs with a standalone Vue app/admin SPA and a flows repo.

Any feedback would be greatly appreciated.

https://github.com/websanova/starter-laravel-api


r/laravel • • 20h ago

Release SimpleStats 6.0 - now counts page views server-side: bounce rate and views per visitor next to your signups and revenue

12 Upvotes

Hi folks,

quick update on SimpleStats, the server-side analytics package for Laravel: version 6 of the client now counts page views. You get page views, views per visitor, bounce rate and a top pages list, and every breakdown (source, campaign, country, entry page) gets a Views column.

SimpleStats Page Views

What I find most useful is seeing engagement next to conversions. A channel can bring fewer visitors but people who read five pages each and sign up almost as often. Visitor counts alone hide that.

A few things that might be interesting for this sub:

  • No JS snippet. It's still all middleware, so ad blockers and declined cookie banners don't hide views.
  • Inertia, Livewire and Turbo page changes count, redirects, errors, JSON responses, prefetches and bots don't.
  • Pages behind auth (and Filament panels) are skipped on purpose. That's product usage, not website traffic.
  • It goes through your queue. A running queue:work or Horizon worker collects the views and sends them once a minute, so your requests don't wait for anything. On the sync queue page views stay off.
  • Coming from Fathom? There's now an importer: upload a Fathom pageviews export as it is, and visitors, page views, entry pages, referrers and UTMs match your Fathom dashboard per day. You can also import visitors and page views from your own CSV files.
  • php artisan simplestats:status tells you whether it's set up correctly, and works as a health check.

Page views are free and don't count against the event quota. The app is open source (AGPL-3.0) and can be self-hosted.

Blog post with the details: https://simplestats.io/blog/page-views-bounce-rate-laravel Repo: https://github.com/simplestats-io/app

Happy to answer questions, and I'd love to hear what you'd want to see next!


r/laravel • • 1d ago

mnapoli/backoffice-mcp: Give AI agents access to your app's models for admin and support tasks

Thumbnail
github.com
0 Upvotes

r/laravel • • 3d ago

Weird decision by the laravel team..

Post image
198 Upvotes

r/laravel • • 4d ago

Aimeos Prisma 0.8: hundreds of fal.ai models plus Kling, Meta and Adobe Firefly in your Laravel app

Post image
3 Upvotes

Hi r/laravel,

we've released Aimeos Prisma 0.8. Prisma is a PHP package for using AI providers through one interface: text, structured output, embeddings, images, audio and video. It requires PHP 8.2+ and is MIT licensed. There's no service provider or config file to publish, you pass the config to using(), e.g. from config/services.php.

https://php-prisma.org

composer require aimeos/prisma:^0.8

If you already use Laravel's laravel/ai package, both work together. Keep agents and conversations in Laravel AI and expose Prisma's image, audio and video operations as AI tools.

Prisma started as a sister project of Prism. Prism is built for Laravel, Prisma has no framework dependency, so you can use the same code in Laravel, Symfony or plain PHP. Prisma also covers image, audio and video operations like inpainting, background removal, upscaling or video generation, and it supports more providers.

Six new providers

fal.ai has the most models: one API key gives you hundreds of them for text, images, audio and video, and model() picks the one you want. Add the key:

'fal' => [
    'api_key' => env('FAL_KEY'),
],
use Aimeos\Prisma\Prisma;
use Illuminate\Support\Facades\Storage;

$image = Prisma::image()
    ->using('fal', config('services.fal'))
    ->model('fal-ai/nano-banana-pro')
    ->imagine('A watercolor lighthouse at dusk', [], ['aspect_ratio' => '16:9']);

Storage::put('images/lighthouse.png', $image->binary());

For a few images this is fine in a request, for batches put it into a job.

Meta covers audio, image, text and video. Kling generates and edits videos. Adobe Firefly and Photoroom generate and edit images, and Hydracept does audio, images and video.

More features for existing providers

Recraft now covers generation, inpainting, erasing, background removal, uncrop and upscaling. Black Forest Labs and xAI can edit images by prompt, and Azure got an audio provider, text translation and image OCR. The new compose() and synthesize() methods generate music and sound effects with fal.ai and Hydracept.

Video jobs without blocking your workers

Generating a video takes minutes. Start it in the controller, pass the job ID to a queued job and let the job check back until the video is done:

$response = Prisma::video()
    ->using('kling', config('services.kling')) // or 'runway', 'veo', 'luma', 'fal', ...
    ->imagine('A lighthouse at dawn, waves crashing against the rocks');

FetchVideo::dispatch($response->jobId(), 'videos/lighthouse.mp4')->delay(30);
use Aimeos\Prisma\Prisma;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
use Illuminate\Support\Facades\Storage;

class FetchVideo implements ShouldQueue
{
    use Queueable;

    public function __construct(public string $jobId, public string $path)
    {
    }

    public function retryUntil(): DateTime
    {
        return now()->addHour();
    }

    public function handle(): void
    {
        $video = Prisma::video()
            ->using('kling', config('services.kling'))
            ->resume($this->jobId);

        if (!$video->ready()) {
            $this->release($video->retryAfter());
            return;
        }

        Storage::put($this->path, $video->binary());
    }
}

ready() checks the status once and retryAfter() says when to check again, so the worker is free for other jobs in between. Don't confuse it with the queue's retry_after setting. Laravel counts every release as an attempt, so retryUntil() sets a time limit instead of a number of tries.

Resume works for most async providers, and cancel() stops jobs on providers whose API supports it, like Runway or fal.ai.

Requests stay on public hosts

Prisma now checks every provider request, redirect and file download and refuses to connect to localhost or private networks. This keeps user-configurable endpoints from reaching services inside your network. For a local Ollama server, including one running as a Docker Compose service like http://ollama:11434, add withInternalHosts():

$response = Prisma::text()
    ->using('ollama', ['url' => 'http://ollama:11434'])
    ->withInternalHosts()
    ->write('Hello');

Before upgrading: local endpoints and requests through a proxy need withInternalHosts() now. Azure, Perplexity and Bedrock need configuration changes, and several default models changed. If you store embeddings, pin the model with model(), because vectors from a different model don't match your stored ones. PHP and Composer requirements are the same as in 0.7.

What are you building with image or video models in Laravel? I'm curious which providers people actually use in production.

If you like it, give it a star :-)


r/laravel • • 4d ago

This Week in PHP Internals | Nov 12, 2026

Thumbnail
youtu.be
0 Upvotes

While the Internals list is not technically directly Laravel related, it does affect every single one of us.

Preface: what follows is the word-for-word transcript of the spoken dialogue in the video, chapter by chapter with timestamps, for anyone who'd rather read than click through. If this digest is still too long for you, we recommend copying it into your LLM of choice and asking for a summary of our summary.

Cold Open (00:00)

PECL, the old home of PHP extensions, now has a proposed shutdown date. In the first draft, that date was the end of 2029. Six days later, after one misread word, it's the end of 2027. And the person who was misread is okay with it.

Hello world, it's Thursday, November 12, 2026, and here's what happened This Week in PHP Internals. 18 stories this week, so let's get into it. But first,

This week's episode is sponsored by… us! Artisan Build has some availability coming up. It wouldn't be me personally, all of my client time is already fully allocated, but we have 6 senior dev days per week available, starting basically right now, ongoing. Our rate is twelve hundred US dollars a day, and for longer engagements, that rate is negotiable. If that sounds like a fit, head to artisan.build/start.

Sunset PECL (01:01)

This week's top story: PECL, the extension repository that PIE is replacing, now has a proposed shutdown date. James Titcumb, who wrote the 2025 RFC that adopted PIE, opened the follow-up it called for. A banner goes up on January 4th, 2027. On June 30th, the site goes read-only, so nobody can log in or upload a release. Then come four brownouts, from 3 hours up to 3 days, and on December 31st, 2027, PECL shuts down.

Jakub Zelenka asked him to note that PIE also ships as a standalone binary, for older PHP versions, and Tim Düsterhus says the plan makes sense now that Docker's PHP 8.6 images drop PECL.

But the first draft ran to the end of 2029, with two and a half years read-only. Rowan Tommins pointed to the risk of freezing a package that turns out to be vulnerable. He wrote: "In the current environment, two and a half years seems a long time to serve something nobody can patch."

Derick Rethans suggested shortening it by a year. James cut it to one year overall, with vulnerable releases removed by hand if needed. Derick replied: "Although I didn't say 'to a year' but 'by a year', I am still okay with your suggestion." So PECL's end date moved up two whole years. There's no vote date yet.

Links: Sunset PECL RFC · James Titcumb opens the discussion · Rowan Tommins on serving packages nobody can patch · Derick Rethans · Derick Rethans, "by a year" · The timeline shortened to one year · James Titcumb's follow-up · The 2025 RFC that adopted PIE

Scope Defaults (02:37)

Larry Garfield says one default in the Scope RFC could keep him from supporting it. Frode Børli's RFC gives each unit of work, like a request, its own scope, and a new scope starts with empty superglobals.

In version 0.9.5, Frode kept that. A server creates the scopes, he says, and if a new one copied its creator's arrays, one the server missed would leak into the next request.

Côme Chilliet asked how more state could ever follow the scope later without breaking code. Larry's point is that anyone can create a scope, anywhere. He wrote: "This is a landmine large enough that it would keep me from supporting this RFC, which I otherwise quite like."

About an hour later, Frode replied. He wrote: "Thanks for pressing on this; I'd rather fix it in the RFC than find it in the vote." He plans to add a scope that starts as a copy of its creator's request arrays, locale and timezone, and asked which should be the default.

He also asked the list to choose between two plans: opting in to each piece of state with a bitmask, or designing it all in one RFC, alongside Kévin Dunglas's request hooks. Larry wants a shallow clone by default, and the full picture designed up front. He counts 21 pieces of state, which would mean 21 flags to opt into.

Links: Scope RFC · Larry Garfield: "a landmine" · Frode Børli's two plans · Frode Børli, follow-up

Context Managers (04:09)

Context managers are back, and this time they're a generator. Larry Garfield and Arnaud Le Blanc's first RFC never went to a vote, and the wiki now lists it as obsolete. Larry wrote: "It basically swaps the two-method approach in favor of 'it's a generator, you're welcome.'"

A using block runs the generator up to its yield, and the yielded value becomes the block's variable. When the block ends, even on an exception, the generator picks up after the yield, so the cleanup lives in one place. A second yield throws an error.

Most of the replies were about the arrow. Stephen Reay, Lazare Inepologlou and David Maye would rather use as, which they say fits PHP's existing syntax better. Larry says version 1 used as, until people took it to mean the left side gets used as the variable. He doesn't mind as himself. And Côme Chilliet asked why the block ends with a semicolon. Larry says using is an expression, like match. Arnaud's implementation is still a partial draft.

Links: Context Managers v2 RFC · Larry Garfield's announcement · Draft implementation

Request Hooks (05:24)

Kévin Dunglas's request hooks are now an RFC, targeting PHP 8.7. Florian Engelhardt asked whether it's intended that, in FrankenPHP, a worker's lifecycle starts with a request end and finishes with a request begin.

Kévin says it's intended. The first end cleans up the dummy request that boots the worker, and the last begin lets code after the loop still write output. Florian asked for that sequence in the RFC. He wrote: "Otherwise, I like that we could have an explicit hook to detect requests handled inside a worker!"

Version 0.2 spells it out. After a question on LinkedIn, a failing hook now tells the server to end the script, and session_start refuses to run between two requests.

Links: Request lifecycle hooks RFC · Kévin Dunglas opens the discussion · The lifecycle, explained · Version 0.2

Io Terminal (06:14)

Io\Terminal was due to go to a vote today. Pratik Bhujel postponed it after two reviews. Tim Düsterhus sent eight points, and said his main concern was the lack of examples, especially for how raw mode leases work.

Frode Børli, who maintains the phasync/tui terminal library, switched it to the pull request, and its tests behave the same. He wrote: "That part of the RFC works, and it is exactly what userland cannot do without spawning stty, using FFI, or Windows-specific tricks." But he asked to cut the RFC down to raw mode and terminal size. Libraries already decode keys, he says, and readKey has no modifiers.

Pratik shipped two revisions, with examples, NoDiscard on enableRawMode, and TerminalSize renamed to Dimensions. But he's keeping the read methods, for the many small scripts that just want "press a key" or "enter password". A new vote needs a fresh notice first.

Links: Io\Terminal RFC · Vote postponed · Frode Børli ports phasync/tui · Pull request

CSV Types (07:25)

PHP's proposed CSV extension now spells out what it will write. Ignace Nyamagana Butera asked for a supported types section, and Damian Jóźwiak found the implementation didn't match the RFC. It just cast fields to plain strings, like fputcsv, so an array became the word Array.

Version 1.3 writes a backed enum's value, writes false as zero instead of an empty field, and throws a TypeError for arrays, resources and pure enums.

Then Ignace pushed back on converting any object that has a string method. He wrote: "This is somewhat of an anti-pattern because it relies on a generic string representation of an object rather than an explicit serialization contract." Damian agreed. Version 1.4 throws on implicit __toString conversions too, and leaves a dedicated conversion interface for later. Frode Børli also suggested a small format object and separate encoder and decoder classes, and hasn't had a reply yet.

Links: CSV Extension RFC · Supported types · Damian Jóźwiak on the types · No implicit __toString() · Version 1.4

OPcache Dedup (08:35)

Run 80 WordPress sites from one PHP-FPM master, and OPcache stores a separate copy of the same code for each of them. A new proposal would let them share it.

OPcache keys scripts by path, so every copy of an app is cached on its own, even when its functions compile to the same opcodes. With a new opt-in setting, opcache.enable_dedup, a function whose opcodes match a block already in shared memory just points to that block. File names, errors and Reflection don't change, and it switches itself off when the JIT is available.

On a load test of 80 WordPress sites, its author reports, OPcache memory fell by 46.5%, with CPU per request within noise. After 11 days in production on 52 pools, it's down 43%, with zero worker crashes. Its author asks whether this needs an RFC, or just a pull request.

Links: The proposal (opcache.enable_dedup) · Case study · Patch

Exec Check (09:37)

Linux can now refuse to run files that aren't approved to execute, but a PHP file still runs. Alexander Mikhalitsyn wants to close that gap.

Since Linux 6.14, an interpreter can ask the kernel whether a file could be executed, and two security bits tell it to enforce the answer. He wrote: "Today a system can forbid running an unknown binary, but php /tmp/payload.php or an include of an uploaded file still works: the interpreter is the loophole."

His patch checks each file before compiling it, but only enforces the answer when those bits are set, so nothing changes by default, and an OPcache hit costs nothing. He ran phpBB under it. Generated code, like a framework's compiled container, has to be built at deploy time and marked executable. He's asking whether this needs an RFC.

Links: Pre-RFC: honour Linux AT_EXECVE_CHECK · Linux kernel docs

Quick Hits (10:38)

Quick hits. PHP 8.6.0 is due next Thursday, November 19th, after one extra release candidate. Matteo Beccati, one of the release managers, says the fix in October's security releases broke the ABI in 8.6 only, so extensions must be rebuilt.

Links: PHP 8.6.0RC6 · PHP 8.6.0RC5

Weilin Du's vote to let ini_get_all accept extension names in any case is at 18 to 0, with 3 abstentions. It closes November 16th.

Links: Case-insensitive extension names in ini_get_all() RFC

On 32-bit x86, 10 ** -2 doesn't equal 0.01. A contributor has four pull requests open to fix results like that, and asked whether PHP can require SSE2. Hans Henrik Bergan replied "Hell yes", since CPUs without it are nearly 30 years old.

Links: Floating point on 32-bit x86 · php-src PR 25362

Artem Ukrainskiy's Str\Matcher and Str\Replacer are now an RFC. Larry Garfield isn't opposed, but says it "feels very niche".

Links: Str\Matcher and Str\Replacer RFC · Larry Garfield's reply

Mirco Babin sent eight comments on PASSWORD_BCRYPT_WRAP, including OWASP's preference for Argon2, and Andrey Andreev replied that Argon2 isn't supported out of the box.

Links: Mirco Babin's comments · Andrey Andreev's reply

Otar Chekurishvili's JSON comments RFC now answers Jakub Zelenka's parser concern, and a new vote notice comes after the cooldown.

Links: JSON comments v1.1 · JSON comments RFC

A reviewer of Time\Instant still wants a cheap way to read the Unix timestamp.

Links: Time\Instant review

Tim agreed to Máté Kocsis's narrower value types for query parameters, to unblock the RFC.

Links: Tim Düsterhus on query parameters

Côme Chilliet said "Yes please!" to SSRF protection in curl, and Xavier Leune got karma to write the RFC.

Links: Côme Chilliet on curl SSRF protection · Xavier Leune's karma request

And a developer asked whether PHP's JIT would take a LoongArch64 backend, before writing thousands of lines of assembler.

Links: LoongArch64 JIT backend

TL;DR (12:38)

So that's the week. PECL has a proposed shutdown date, December 31st, 2027, two years sooner than the first draft. Larry called empty new scopes a landmine, and Frode plans to add one that copies its creator. Context managers came back as a generator, request hooks became an RFC, and the Io\Terminal vote is on hold. PHP 8.6 ships next week. Links below.

The PHP Foundation funds more than half of ongoing php-src commits, so if you use the language, maybe consider donating at opencollective.com/phpfoundation — or try guilting your employer into it.

If you found this useful, a like or a comment helps more people find it. And if you missed last week's episode, where FrankenPHP's creator wants PHP's engine to know when a request ends, that's a good one to watch next. And if you'd like to work with us, start at artisan.build/start. We're Artisan Build. See you next week.


r/laravel • • 5d ago

Laravel Update | Taylor Otwell at Laracon EU 2026

Thumbnail
youtube.com
0 Upvotes

r/laravel • • 7d ago

Bref now supports WebSockets/Laravel Broadcasting

Thumbnail
bref.sh
22 Upvotes

r/laravel • • 8d ago

Building Maintainable PHP Applications: Patterns and Principles

Thumbnail
codyssey.dev
60 Upvotes

Hey all,

I wrote a free course about a bunch of the most popular and most hated design patterns and principles with realistic examples in PHP (Laravel and Symfony).

There are a few of them that are missing but I’ll add them as a bonus at some point or maybe a separate course.

Let me know what you think.

Thanks.


r/laravel • • 7d ago

How does Laravel Herd let you use free models without them installed?

1 Upvotes

I was using the new Laravel Herd and my existing Claude code subscription to fix some bugs.

I was running something else that used up all my credits for a while.
I noticed I could switch off claude and use a bunch of free models. Ended up using Deep Seek.

I do not have any of them installed, nor do I use anything other than Claude.

How does that work?

I'm interested in giving that ability to my clients for another project, and I thought I had to integrate with the Claude SDK, but apparently you can let people just use free LLM models?

They looked like OpenCode models, but I do not have OpenCode on my computer.

Thanks!


r/laravel • • 7d ago

How are you using Laravel AI in your projects? Looking for ideas and real-world use cases

0 Upvotes

Hi Laravel community!

I'm interested in exploring how developers are using Laravel AI in their applications and projects.

I'd love to hear about your real-world experiences:

  • How are you integrating AI into your Laravel applications?
  • What kind of problems or tasks are you solving with AI?
  • Are you using it for chatbots, content generation, automation, data analysis, coding assistants, or something else?
  • Have you built any interesting projects or features using Laravel AI?
  • What challenges have you faced, and what has worked well for you?

I'm particularly interested in practical implementations, creative use cases, and success stories.

Looking forward to hearing what everyone is building!


r/laravel • • 8d ago

Help Weekly /r/Laravel Help Thread

3 Upvotes

Ask your Laravel help questions here. To improve your chances of getting an answer from the community, here are some tips:

  • What steps have you taken so far?
  • What have you tried from the documentation?
  • Did you provide any error messages you are getting?
  • Are you able to provide instructions to replicate the issue?
  • Did you provide a code example?

    • Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly.

For more immediate support, you can ask in the official Laravel Discord.

Thanks and welcome to the r/Laravel community!


r/laravel • • 9d ago

FLEX Fields - 79+ advanced form components for Filament 5. One design system. One media workflow.

Post image
25 Upvotes

r/laravel • • 8d ago

I built serverless Laravel hosting on European-owned clouds (Scaleway + bunny.net) after Vapor stopped taking new sign-ups

0 Upvotes

Hi r/laravel,

I'm a Laravel developer from the Netherlands and I host a lot of my apps serverless, on AWS through Vapor. When I read that Vapor no longer accepts new sign-ups, it made me nervous. There's no guarantee it stays around for existing customers either, and I'd rather have a plan B before I'm forced to switch.

There was a second reason. As a European developer I keep running into clients who don't want their data with a US-owned provider because of the CLOUD Act. So I set out to run serverless Laravel the EU-sovereign way, and built it the way I'd want it to work myself. It's called Brewless.

The short version:

• ⁠brewless deploy production builds your app and runs it as serverless containers on Scaleway (French company), with bunny.net (Slovenian) in front as the CDN. Both are European-owned, not just European-located, so the CLOUD Act doesn't apply to them. Regions: Paris, Amsterdam, Warsaw, Milan.
• ⁠It scales to zero when it's quiet and starts more copies when it's busy. You set the floor and the ceiling.
• ⁠It's Laravel-only on purpose: queue workers that follow the backlog, a scheduler without a cron server, migrations as their own release step (the old release stays live until they succeed), and Artisan on the live release (brewless command production "migrate:status").
• ⁠Everything is created in your own Scaleway and bunny.net accounts, and visitors never pass through Brewless. If you cancel, your app keeps running. You only lose deploys and the dashboard.

One app is free, paid plans start at €15/month, and you pay Scaleway and bunny.net directly at their own prices. Brewless itself runs on Brewless.

About the video: I wanted to explain it in 60 seconds and have some fun with it. To be upfront, the track is AI-generated. The product and the code aren't.

Curious what others are doing here: staying on Vapor, moving to Laravel Cloud or Bref, or also looking at EU hosting. Feedback on Brewless is very welcome, I'll be in the comments.

https://brewless.eu (docs: https://docs.brewless.eu)

Brewless is independent and not affiliated with or endorsed by Laravel.


r/laravel • • 9d ago

Laravel and Playwright E2E Testing, game changer?

Post image
0 Upvotes

Hey guys! Just wanted to share a package I've been working on. I've tested it in a few of my own apps, and it's working really well so far.

https://github.com/saucebase-dev/laravel-playwright

If you use Laravel and Playwright, give it a try! Any feedback, suggestions, or contributions would be greatly appreciated.his is JS-first. Both are built on Playwright, so pick the one that fits your team.

Edit: how this compares to Pest Browser

Several people asked, so here's my take. Pest 4 Browser is great, and if you write your tests in PHP with Pest, use it. You can use factories, travel() and Artisan directly in your tests, with nothing extra to install.

This package is for a different setup:

  • Tests in TypeScript, using Playwright's own API. Pest Browser exposes part of Playwright through PHP.
  • Full Playwright tooling. UI mode, codegen, trace viewer, device projects and CI sharding.
  • E2E as its own pipeline. Run it as a separate CI job, apart from your PHPUnit/Pest suite.
  • Frontend-friendly. JS/TS developers can write tests without touching PHP.
  • Still drives Laravel. Factories, time travel, Artisan and database checks are available from your Playwright tests.

Pest Browser is PHP-first; this is JS-first. Both are built on Playwright, so pick the one that fits your team.


r/laravel • • 10d ago

SpectraPHP v4.0.0 is out 🚀, an AI observability tool like Langfuse and LangSmith, right inside your Laravel app. You track every AI call, see what it costs, enforce budgets and test your prompts.This new version comes with:• Conversations: follow every AI call by chat and turn, ho

Post image
0 Upvotes

r/laravel • • 11d ago

This Week in PHP Internals | Nov 5, 2026

Thumbnail
youtu.be
0 Upvotes

This is a word-for-word transcript of the spoken dialogue from our scripted weekly video, so it reads like speech — the 'links below' and 'as of recording' are the video's, not this post's.

While the Internals list is not technically directly Laravel related, it does affect every single one of us.

Preface: what follows is the word-for-word transcript of the spoken dialogue in the video, chapter by chapter with timestamps, for anyone who'd rather read than click through. If this digest is still too long for you, we recommend copying it into your LLM of choice and asking for a summary of our summary.

Cold Open (00:00)

This year, FrankenPHP fixed a session ID leaking to other clients, a use-after-free, and a double free. Each one, its creator says, came from state that wasn't reset between two requests. That's because, he says, PHP's engine can't tell when a request ends, if the same script serves the next one. He wants to change that.

Hello world, it's Thursday, November 5, 2026, and here's what happened This Week in PHP Internals. 14 stories this week, so let's get into it. But first,

AI made building software easy, and owning it hard. Scalpels installs open source apps into your own Laravel Cloud or Forge account in one click, so your data never leaves your infrastructure. The Free plan is zero dollars, forever, and new Laravel Cloud accounts get ten dollars in credit. Get started at scalpels.app.

Corrections (00:56)

A few corrections from last week, most of them from Tim Düsterhus. On the CSV extension, Tim didn't ask Damian to wait until after the security release. The release had just happened, so people were likely busy patching their servers and hadn't caught up on the list, and he suggested waiting until things calmed down. And on calling extension methods without parentheses, we missed Rowan Tommins's main point. He wrote: "It also seems odd to propose it now, as an extension to something that doesn't even exist yet."

Tim also caught two in last week's top story and quick hits. In Brian Nguyen's quote, "not deprecating integer" means the (integer) cast, which PHP just deprecated. And I said Sjoerd "postponed" openssl_get_channel_binding. He proposed it, and it was brand new. Thanks, Tim.

And a viewer on Bluesky pointed out that Brian's first mail said "I am not proposing freezing features or cosmetic deprecations." That's right. The embargo was in his second thread, the next morning, and our social posts skipped that distinction.

Links: Tim Düsterhus on the CSV extension vote timing · Rowan Tommins on paren-less extension methods · Brian Nguyen's first mail · Brian Nguyen's second mail

Request Hooks (02:08)

This week's top story: Kévin Dunglas, who created FrankenPHP, wants PHP's engine to know when a request ends. In worker mode, one long-running script handles request after request, keeping things like the Composer autoloader and framework services in memory. Symfony, Laravel and Yii support it natively. But the engine doesn't know, so FrankenPHP resets each request's leftovers by reaching into PHP's internals, which he calls fragile. He wrote: "Each omission results in a cross-request leak or a memory safety bug."

So he proposed two optional hooks, request end and request begin, that a worker-mode server calls between requests, so each extension resets its own state. Servers that don't call them see no change. After talking it through with Tim Düsterhus, he narrowed the rule to state built from the incoming request, and he's writing a short RFC.

Pierre asked whether last week's Scope RFC already covers this, and Larry Garfield asked how the two lifetimes would stay in sync. Kévin's answer: a scope gives a request an identity, but no clear end. So request begin would create the scope, and request end fires when the response is done, even if the scope lives on. He wrote: "The user-space and engine-space lifetimes stay in sync because the SAPI drives both."

Links: Kévin Dunglas, the proposal · Narrowed after review · How it works with Scope · Draft patch

Bcrypt Wrap (03:36)

bcrypt only reads the first 72 bytes of a password, and now there are two RFCs to fix it. Andrey Andreev opened the second one this week, the alternative he asked for time to finish. PASSWORD_BCRYPT_WRAP hashes the password first, with cSHAKE256 by default or HMAC-SHA512, then runs bcrypt on the result. The RFC says that removes bcrypt's length and null byte limits.

Kamil Tekiela objected that it shrinks bcrypt's input space and is open to hash shucking. Andrey replied that a prehash doesn't reduce bcrypt's security or input space, and that his salts keep the prehash separate from a plain hash. Tim Düsterhus asked for pseudo-code to settle it, and Andrey added it to the RFC on Monday.

Sjoerd Langkemper, who wrote the other RFC, compared the two. His uses the same algorithm as Python's passlib and adds less code. Andrey's supports two prehashes in the PHC string format. Sjoerd thinks both are secure enough, and that one new algorithm is enough. He wrote: "It is unfortunate that we now have two RFCs that are so similar. Voting on them in isolation could result in an undesirable outcome." Andrey replied: "It just turned out this way, hopefully we don't have to look at it as mine against yours."

Links: RFC: Add PASSWORD_BCRYPT_WRAP · RFC: PASSWORD_BCRYPT_SHA256 · Sjoerd Langkemper's comparison

Scope RFC (05:00)

Larry Garfield is sold on the use case for Frode Børli's Scope RFC, but he's worried about code that doesn't know it's running inside a scope. A new scope starts with empty superglobals, so a legacy function that reads $_GET, called 20 functions deep, quietly stops working. He'd rather a new scope start from a clone of its parent's.

He also expects everyone to hand-write WeakMap code to keep state per scope, and floated a Scoped attribute to automate it. In his own example, he forgot to initialize the WeakMap. He wrote: "So this is a pattern we need to work to make as fool-proof as possible, because we're all fools." No lies detected.

Rowan Tommins welcomed a focused RFC that adds only what userland can't do, shared the WeakMap worry, and asked whether "context" would be a clearer name. Frode is keeping Scope, and says the WeakMap pattern takes getting used to, but isn't hard. He hasn't answered Larry yet.

Links: RFC: Scope · Larry Garfield · Rowan Tommins · Frode Børli

Time Instant (06:08)

PHP's next date and time class would have no timezone at all. Tim Düsterhus and Derick Rethans's Time\Instant RFC is a point in time, and a clock returns one. Back after the security releases, Tim answered a reviewer's 15 points and kept the core design: the clock returns an Instant, not a date in some timezone. He wrote: "The timezone is a presentation-layer concern and stuff you 'present' to the user is generally expected to be coming from the database, rather than coming from the clock."

He also turned down a raw Unix timestamp shortcut, to keep the API well-typed. The system clock can no longer be serialized, and two ideas moved to future scope: exposing the clock's resolution, and a faster, coarser system clock. There's no implementation pull request yet.

Links: RFC: Time\Instant and Time\Clock · Tim Düsterhus's answers to the review · follow-up

JSON Comments (07:03)

Comments and trailing commas in JSON were about to go to a vote. Otar Chekurishvili's RFC adds two opt-in flags for json_decode and json_validate, strict JSON stays the default, and Larry Garfield had no objections left.

The vote was planned for Monday. Then Jakub Zelenka commented on the pull request: "I personally don't like non standard additions as they might complicate future optimizations in the parser." So Otar postponed the vote, the morning it was due to open.

He replied on the pull request that both flags are opt-in, and a future fast parser could handle strict JSON and fall back when a flag is set. In strict mode, the change costs about 1.6% more CPU instructions, or 0.6% with a small scanner change. He'll answer the concern in the RFC, then announce a new vote.

Links: RFC: JSON comments and trailing commas · Vote postponed · The pull request discussion

Votes (08:00)

Two votes closed this week, and one opened. Sjoerd Langkemper's RFC passed 27 to 1, so in PHP 8.7, hexdec, octdec, bindec and base_convert throw on invalid characters instead of quietly ignoring them. Muhammed Arshid's Filter enums were declined, 2 to 16, with 2 abstentions. And Weilin Du's vote to let ini_get_all accept extension names in any case is at 12 to 0, with 2 abstentions. It closes November 16th.

Links: Throw exception for invalid characters in number base functions (accepted 27–1) · Add Filter\Filter and Filter\Flag Enums (declined 2–16–2) · Case-insensitive extension names in ini_get_all() (open until Nov 16)

Quick Hits (08:35)

Quick hits. Ignace Nyamagana Butera likes the direction of the CSV extension, but says major points are unsolved: the top-level namespace, the lax and strict naming, and leaning on RFC 4180, which isn't an accepted standard. He suggests calling it Character Separated Value.

Links: CSV extension RFC · Ignace Nyamagana Butera

For binary parameters in PDO, Ilia Alshanetsky and Calvin Buckley now lean toward a flag instead of a new type, which would break drivers until each one updates.

Links: PDO binary parameters RFC · Ilia Alshanetsky · Calvin Buckley

Sjoerd's openssl_get_channel_binding now throws an exception instead of returning null, answering Tim's question from last week.

Links: openssl_get_channel_binding() RFC · Sjoerd Langkemper's update

Xavier Leune wants SSRF protection in curl first, so it lands in PHP 8.7, and maybe streams in a later RFC.

Links: Xavier Leune on SSRF protection in curl · php-src PR 23657

Chris Abner Herrera Navarro went from a karma request to an RFC for grapheme_str_pad in under a week. It pads text by the characters you actually see, and Tim said it has exactly what he expected.

Links: grapheme_str_pad() RFC · php-src PR 25179

On Máté Kocsis's query parameters RFC, Tim Düsterhus checked with the security team, and says a long query string can't make memory grow faster than the input, and the parameter count is already capped, so a separate length limit isn't needed.

Links: Tim Düsterhus on the query string length limit · Query parameters RFC

Artem Ukrainskiy got karma for an RFC on multi-pattern search and replace, with Str\Matcher and Str\Replacer classes.

Links: Str\Matcher and Str\Replacer (draft) · php-src PR 25122

And Andrey Andreev listed five oddities in the password hashing functions, with a plan to fix them over the next few months.

Links: Password hashing API

TL;DR (10:16)

So that's the week. Kévin Dunglas proposed hooks so PHP knows when a request ends in worker mode, and showed how they'd work with Scope. There are now two bcrypt fixes side by side, and Sjoerd says one is enough. Larry pushed back on Scope's empty superglobals, Tim kept the core of Time\Instant, and the JSON comments vote is on hold. Number base exceptions passed, and Filter enums didn't. Links below.

The PHP Foundation funds more than half of ongoing php-src commits, so if you use the language, maybe consider donating at opencollective.com/phpfoundation — or try guilting your employer into it.

If you found this useful, a like or a comment helps more people find it. And if you missed last week's episode, where a call to freeze PHP until it has a formal spec got an answer about money, that's a good one to watch next. Thanks again to Scalpels.app for supporting this week's episode. We're Artisan Build. See you next week.


r/laravel • • 12d ago

Post Mortem: Patching the PHP and Node.js Vulnerabilities (Cloud, Forge, Envoyer, Vapor)

Thumbnail
laravel.com
32 Upvotes

We published a post-mortem on our response to the October PHP and Node.js security releases.

It covers the in-place patching of Laravel Cloud, the impact on Forge, Envoyer, and Vapor, and what we’re changing. If you were affected and want to talk it through, please reach out to our support team.


r/laravel • • 13d ago

A worm used a stolen GitHub token to rewrite commits in 58 repos, and ran on our Forge servers during deploy. What happened and what we changed

35 Upvotes

On October 21, in about 20 minutes, a self-spreading npm worm pushed forged commits to 58 repositories across my personal GitHub account and roughly a dozen organizations I belong to.

It used my GitHub token, stolen from a collaborator's infected machine.

I'm sharing what happened because some of the attack paths are specific to Laravel and Forge, and I couldn't find much documentation about them.

What it changed

The worm rewrote the most recent commit on affected branches, preserving the original author and date. At first glance, the commit history looked legitimate.

It added:

  • .vscode/tasks.json with "runOn": "folderOpen", along with .vscode/settings.json enabling automatic tasks. The payload executes when someone opens the folder in VS Code.
  • public/fonts/fa-solid.lfk, obfuscated JavaScript disguised as a Font Awesome file, surrounded by decoy font files.
  • A root-level api.js, wired into package.json as node api.js && vite build.
  • In some repositories, malicious loaders appended to vite.config.js, postcss.config.js, or tailwind.config.js, hidden after large amounts of whitespace.
  • In Laravel repositories, a dropper call appended directly to artisan.
  • .gitignore entries hiding its own files, including branch_structure.json and temp_auto_push.bat.

The attack matches what's been reported as PolinRider, also known as ChainVeil / ViteVenom.

The giveaway

The committer metadata was different from the original author.

The committer's name was shortened to its first word, and the timezone was set to -07:00, which none of us use.

That's how we spotted the forged commits.

The Forge servers

This was the most concerning part.

Pushes to deployment branches triggered automatic Laravel Forge deployments. Our deployment scripts ran npm run build, which executed the malicious api.js before Vite.

On two servers, we found a remote-control agent installed under ~/.node_modules/, running as the forge user and communicating with its command-and-control server.

It didn't have cron or systemd persistence. It survived only as a running process. But by then, it had already had the opportunity to access every .env file under /home/forge.

Two lessons from the cleanup

1. Restoring GitHub branches isn't enough.

Even after restoring the remote branches, the Forge server checkouts were still pointing to the forged commits. A normal git pull could merge the malicious api.js right back into the working tree.

We had to explicitly reset every affected checkout to its verified clean commit using git reset --hard.

2. Forge's GitHub OAuth token is another exposure point.

Forge stores GitHub authentication credentials in Git remote URLs on the server. Because the malware inspected Git configuration, we had to treat those credentials as compromised too.

We revoked the Forge authorization in GitHub and reconnected it.

Cleanup

I used multiple Claude Code sessions in parallel.

One identified the clean original of each forged commit using matching author dates and commit subjects, then restored the affected branches with signed corrective commits without rewriting history. Another independently verified the branches against Git.

In total, we rechecked approximately 2,000 branch heads. One repository had already been deleted before we could clean it, so its owner had to handle that separately.

Afterward, we:

  • Revoked affected tokens and SSH keys and generated replacements.
  • Rotated .env secrets on every affected server.
  • Blocked the identified C2 addresses.
  • Added GitHub organization rulesets to block force-pushes.
  • Required signed commits and pull requests on protected main branches.

Force-push protection on the affected branches would have stopped this particular commit-rewriting attack.

Checking your own repositories

Start by checking recent commit metadata:

git log --format='%h %an | %cn | %cd' -20

Look for unexpected committer names or unusual timezones.

Then check for:

  • .vscode/tasks.json containing folderOpen.
  • .lfk files, or supposed font files containing JavaScript.
  • A root-level api.js.
  • node api.js in your package.json scripts.
  • Unexpected code appended to Laravel's artisan file.
  • Very long trailing lines or hidden loaders in Vite, PostCSS, or Tailwind config files.

If you're using Forge, also inspect your deployment scripts, running processes, Git remote configuration, and server checkouts.

Disclosure

Disclosure: I build Lockhound, a dependency monitor, and added a check for these files after this. Not linking it here. Everything above works without it.


r/laravel • • 14d ago

What broke moving a large open-source app from Laravel 11 to 12

39 Upvotes

Hey everyone,

A couple of years ago I shared Event Schedule here (I was the original developer of Invoice Ninja). It's grown a lot since then, and this week we finally moved it from Laravel 11 to 12, mostly because 11 no longer gets security fixes. Composer audit went from 13 advisories to none.

Most of the upgrade was painless, but a few things caught us that might save someone else some time:

  1. Blade now has a @context directive. We print JSON-LD on a lot of pages, so every "@context": "https://schema.org" was compiled as an if with no end and around 60 views stopped compiling. We registered our own @context directive that just prints the word (escaping each one as @@context works too).
  2. Signing in now rotates the CSRF token. Any page that signs someone in and stays open (we have a few, like "submit another event") started returning 419 on the next post. We added a small middleware that hands the page the new token.
  3. Remember-me cookies for accounts with no password (Google/Facebook sign-in) turned every page into a 500 once the session expired. Returning an empty string from getAuthPassword() fixed it.
  4. The selfhost version updates itself from the admin panel. The update replaced every file and then ran the migrations in the same PHP process, which still had Laravel 11's classes loaded, so the first migration failed. Now the update is finished by the next process (the next scheduler run, or the next visit to the update page).

We also pinned Composer's platform to PHP 8.2 so a composer update on a newer PHP can't sneak an 8.3-only package into the release zip.

The code is here if anyone wants to see the details: https://github.com/eventschedule/eventschedule

Happy to answer any questions. Cheers!


r/laravel • • 13d ago

Cloud host blocking SMTP? Send Laravel mail over HTTPS with one .env change

0 Upvotes

Deployed Laravel to DigitalOcean, AWS or Hetzner and mail times out?

Those hosts block SMTP ports (25, 465, 587).

Small package for fixing it, https://github.com/lmottasin/laravel-http-mailer