r/laravel • u/nunomaduro • Jul 01 '25
Discussion FILAMENT 4 is 3x FASTER?! Mind-Blowing Upgrade!
r/laravel • u/nunomaduro • Jul 01 '25
r/laravel • u/trideout • Sep 05 '22
A quick rundown on how SemVer (Semantic Versioning) works: There are three main components to a proper version, Major.Minor.Patch. The major version increments on backward-breaking changes, the minor version is incremented when new backwards compatible changes are implemented, and the patch version is for security fixes, bug fixes and other minor backwards compatible changes.
Now you may be thinking, “Okay, that’s exactly what Laravel does?!” and you wouldn’t be completely wrong, however Laravel is doing this for the wrong audience. There is a key line in the SemVer specification that might explain this.
“In systems with many dependencies, releasing new package versions can quickly become a nightmare. If the dependency specifications are too tight, you are in danger of version lock (the inability to upgrade a package without having to release new versions of every dependent package).” semver.org
So how many libraries currently list Laravel as a dependency? As of writing, packagist.org lists 34,421 tagged for Laravel. Obviously not all of these packages are up to date or even intended for the latest version of Laravel, but you can draw your own conclusions here. Now, how many of these packages will be compatible with Laravel 10 when it releases in February 2023? Zero. No matter how many or how few backwards breaking changes there are in Laravel 10, not a single one will be installable via composer on release day. This is the very definition of “dependency hell”. So, if Laravel is following SemVer, which is specifically intended to prevent this kind of issue, why is this happening?
The culprit can be easily found here in the composer.json
Every instance of an illuminate package references the version “self.version”. When executed, composer replaces these references with the current stated version of the framework, even if there have been literally no changes to that repository besides the creation of the new tag.
A Quick Lesson on Composer: When developing with a framework such as Laravel, composer is your gateway to any libraries you may want to integrate. You define the version of the library you want to include, and it is imported into your project and made accessible via the PHP autoloader. You can be as vague or as specific as you want with the version, defining the branch, tag, major version, minor version or patch level. If you want to keep up to date with new features and security/bug fixes, you simply define it like this ^1.2.4. The caret character there will keep you up to date with any non-backwards compatible changes in that library. It is very similar to the wildcard version 1.*. This is all by design, composer is fundamentally acting as a SemVer gatekeeper, making sure that you can quickly update everything without breaking your code base. However, libraries designed for Laravel almost NEVER reference the laravel framework, they reference the individual components within Laravel that they need, known as the “Illuminate” components. These components are individually tagged with versions, but importantly, they do NOT follow SemVer.
When developing a package, you only really care about the stuff that is backwards breaking to YOU. So when I’m writing a new database driver, I only care about breaking changes in “illuminate/database”. If Laravel changes from Blade to Twig, I don’t care, that doesn’t effect my database driver. However the implementation of versioning in Laravel is top-down, not bottom-up. A change in the templating engine updates the Framework version, and all Illuminate packages are updated to match the framework version. This might not seem that bad initially, however it has already caused a LOT of issues, not just for the library developers, but for the end users and even for the Framework itself.
We fought hard for an LTS version of Laravel back when 5.5 was released, however it is now officially out of support and there do not appear to be any plans for a new LTS version. This is most likely due to the difficulty of what is called “backporting”. Since the changes that are requested are being made on the framework, figuring out where they belong on the version structure of a constantly updated, though frequently unchanged, sub-repository can be very hard. There are obviously a number of techniques and scripts to maintain this in the open source community, however they don’t really work well in this backwards version of SemVer.
It’s also easy to find post after post on various sites about being totally version locked due to libraries that have not been updated yet after a new version of Laravel has been released. Your choice here is either issue a PR and wait for the maintainer to accept it, or fork the repo and go through an override process in your composer.json to reference your branch. Then there are the thousands of library maintainers that have to update their composer files any time there is a version bump on the framework, simply because the bump on the required illuminate packages comes with it. For all parties involved, it’s an obvious waste of time.
I’ve been told in the past that this change simply isn’t possible, as it is the fundamental build pipeline for Laravel. PR’s are issued to the framework, not the Illuminate packages. While I agree that it’s difficult, it’s obviously not impossible. Not only that, it provides several huge benefits to the maintainers of the framework itself. Each illuminate repository would have its own changelog which documents the history of the specific repository which could be easily compiled into the latest changelog for the framework. Maintaining back ported versions of security updates would also be much easier through automation and management tools as an LTS version could continue to run the latest patch level of a repository without including breaking changes in newer versions. Finally, maintaining a sub-framework such as Lumen would no longer require porting of new features or bug fixes, as they would automatically be included in a standard composer update call.
There are many other benefits to making these changes, beyond what I can list here, however I feel that this is the next step that is necessary for Laravel to truly become an enterprise project.
r/laravel • u/AshishDhamala • Mar 14 '22
r/laravel • u/Objective_Read_193 • May 06 '26
TL;DR:
I benchmarked nwidart/laravel-modules vs internachi/modular under real concurrent load (PHP-FPM + wrk, 100 connections, 60s windows).
At 0 modules they tie (84 vs 82 req/s). The test rig is clean.
At 100 modules internachi wins by 62% (40 vs 25 req/s).
The big one: at 50 modules, nwidart's plain endpoint drops from 32 req/s at 16 workers to 1.9 req/s at 32 workers, with 2,066 errors across 3 runs. internachi at the same load: zero errors.
A previous post measured single-request boot time. This one measures sustained throughput. Different question, different answer.
I'm building a modular Laravel SaaS starter (Saucebase) and needed to pick a module package. Two real options: nwidart/laravel-modules (incumbent, well documented) and internachi/modular (newer, Composer-native).
Both work fine in development. The question I cared about: does the choice actually matter under production concurrency?
This benchmark answers that.
Two endpoints:
/benchmark/bare: plain 200 OK. Isolates module system overhead.
/benchmark/data: paginated users from MySQL. Adds real I/O.
Two experiments:
E1: 0 / 25 / 50 / 100 modules at a fixed worker budget. Measures how each system scales with module count.
E2: 50 modules fixed, 8 → 16 → 32 → 64 → 126 workers. Measures where each system breaks under concurrency.
Why 0 modules? Both systems should perform identically at 0. If they don't, the rig is biased.
Worker count is calculated from RAM, not hardcoded. Boot 16 workers, measure RSS, then floor(budget_mb / per_worker_mb). Mirrors how ops actually provisions.
3 runs per data point, median reported. Single wrk runs are noisy (JIT, GC, OPcache, scheduler).
| Parameter | Value |
|---|---|
| Host | macOS, Docker Desktop, 8 CPUs, 8 GB RAM |
| Container memory | 4 GB |
| PHP-FPM | pm = static |
| OPcache | Enabled, 100-request warm-up before each window |
| Sessions / Cache | Redis (so MySQL session table isn't in the hot path) |
| Telescope | Disabled |
| Load tool | wrk, 8 threads, 100 connections, 3 × 60s, median reported |
| Branches | internachi: feat/internachi-modular · nwidart: main |
| Framework | Laravel 13, PHP 8.4 |
A few choices worth flagging:
pm = static: pre-forked workers. Isolates module overhead from process spawn cost.
Redis sessions: the first version of this benchmark used DB sessions and the MySQL sessions table contention masked everything. More on that below.
Telescope disabled: at 100 connections, Telescope's MySQL inserts dwarf any module system cost.
Fresh clone per system: earlier runs left modules behind, so the baseline wasn't comparable.
Throughput (req/s), bare endpoint, max:1024
Modules │ internachi │ nwidart │ internachi advantage
────────┼────────────┼────────────┼────────────────────────
0 │ 84.4 req/s│ 82.0 req/s│ +3% (noise, baseline)
25 │ 62.4 req/s│ 48.0 req/s│ +30%
50 │ 41.0 req/s│ 34.5 req/s│ +19%
100 │ 40.3 req/s│ 24.8 req/s│ +62%Throughput (req/s), data endpoint, max:1024
Modules │ internachi │ nwidart │
────────┼────────────┼────────────┼
0 │ 66.6 req/s│ 57.9 req/s│
25 │ 50.5 req/s│ 48.3 req/s│
50 │ 53.8 req/s│ 26.9 req/s│
100 │ 37.1 req/s│ 23.1 req/s│At 0 modules they tie. The rig is clean. Anything after that is the module system.
From 0 to 100 modules:
internachi loses 52% (84 → 40), then plateaus from 50 modules onward.
nwidart loses 70% (82 → 25), and the curve keeps falling.
Same module count, varying worker count:
Throughput (req/s), bare endpoint, 50 modules
Workers │ internachi │ nwidart │ Notes
────────┼────────────┼────────────┼────────────────────────────
8 │ 36.7 req/s│ 30.1 req/s│ both clean
16 │ 43.4 req/s│ 32.0 req/s│ both clean, peak for both
32 │ 42.7 req/s│ 1.9 req/s│ ⚠ nwidart collapse
64 │ 42.9 req/s│ 1.0 req/s│ nwidart non-functional
126+ │ 37.9 req/s│ 1.2 req/s│ nwidart bare collapsed in all 3 runsnwidart loses 94% of throughput between 16 and 32 workers. From 32 req/s clean to 1.9 req/s with 2,066 errors. At 64 workers: 1.0 req/s. internachi at the same load: zero errors at every step.
The clearest signal it's not just I/O:
At max:1024 (~126 workers), 50 modules, nwidart:
/benchmark/bare → 1.2 req/s, errors in all 3 runs
/benchmark/data → 23.0 req/s, 0 errors in all 3 runsThe endpoint that hits MySQL works. The endpoint that does no I/O at all collapses. Whatever's breaking is in the module system's hot path, not the network or DB.
internachi: module discovery is baked into Composer's PSR-4 classmap at install time. At runtime the classmap sits in OPcache shared memory. Every worker reads the same immutable page. No I/O, no locking, no coordination.
nwidart: keeps its own registry: modules_statuses.json plus per-module module.json files. Each worker boot reads them. Fine when one developer hits one request. When 32 workers boot at once on a hot endpoint, they end up contending on shared state.
The collapse pattern (errors every run, bare dies while data survives) fits lock contention on the registry under concurrent worker bootstrapping. internachi has no global state to contend on.
This failure mode does not appear in development. It only shows up at production concurrency with realistic module counts. You also wouldn't catch it just by reading the source code.
1. Session driver kills your benchmark if it's wrong. First run used SESSION_DRIVER=database. All FPM workers contended on the MySQL sessions table. Every system at every module count came back as ~2.4 req/s. The module-system difference was completely masked. Switched to Redis, everything changed. If your numbers all look the same no matter what you change, check your session driver.
2. FILE_APPEND | LOCK_EX destroys concurrent benchmarks. A logging middleware took a process-wide lock for one log line per request. Latencies hit 9+ seconds with a single module loaded. Removed the lock, latencies dropped to expected. Anything that takes a global lock in the request hot path will dominate the result.
3. The "fits in RAM" worker formula overprovisions hard. floor(budget_mb / per_worker_mb) says you can fit 130 to 256 workers on 8 cores. The CPU can't usefully schedule that many. The real productive ceiling here is closer to 16 to 32 workers. Don't fill RAM, watch the CPU saturation point.
Community size, docs, DX, and migration cost are real factors but were not measured here, so they're absent.
| ✅ Measured strengths | ❌ Measured weaknesses |
|---|---|
| 0-module baseline: 82 req/s (matches internachi's 84 req/s) | 50 modules at 32 workers: 94% throughput drop from the 16-worker peak (32 → 1.9 req/s) with 2,066 errors across 3 runs |
| Tolerates over-provisioning when no modules are loaded: 80 req/s at 256 workers vs 82 req/s at ~130 workers (essentially flat) | 0 → 100 modules at max:1024: 70% throughput loss (82 → 25 req/s) with no plateau |
| Data endpoint kept serving 23 req/s with 0 errors at 126 workers / 50 modules, even while the bare endpoint collapsed in every run | Bare endpoint collapsed in all 3 runs at max:1024 with 50 modules (1.2 req/s, errors in every run) |
| ✅ Measured strengths | ❌ Measured weaknesses |
|---|---|
| 0-module baseline: 84 req/s (matches nwidart's 82 req/s) | At 256 workers / 0 modules: 47 req/s, 44% below its own ~130-worker baseline (nwidart held 80 req/s at the same configuration) |
| 0 → 100 modules at max:1024: 52% throughput loss but the curve plateaus; at 100 modules still serves 40 req/s vs nwidart's 25 (+62%) | Throughput saturates at 16 workers with 50 modules: 43 req/s flat from 16 to 64 workers (extra workers add no throughput) |
| Zero errors at every worker count from 8 to 126 with 50 modules | One non-median run at max:1024 produced 97 errors; the other 2 runs were clean (slight instability hint at very high worker counts) |
| internachi/modular | nwidart/laravel-modules | |
|---|---|---|
| Baseline (0 modules) | 84 req/s | 82 req/s |
| At 100 modules | 40 req/s (−52%) | 25 req/s (−70%) |
| Worker-collapse threshold | None observed ≤ 64 workers | 32 workers |
| Concurrency sweet spot | 16–32 workers | 8–16 workers |
| Scales with module count | Sub-linear (plateaus) | Linear (no plateau) |
Error-free at max:1024 (~130w) | Yes | No |
If your production app runs more than 16 concurrent FPM workers and grows past ~25 modules, the data favors internachi clearly. nwidart is fine at lower scale or lower concurrency, but the cliff is real and worth knowing about before you hit it.
The earlier benchmark (single-request boot time) showed nwidart faster below 175 modules. Both can be true. One request at a time, nwidart's file-scan curve looks fine. 100 concurrent connections plus 32 workers bootstrapping in parallel, the registry becomes a contention point that doesn't show up in single-request timing.
The variable that matters most is your production worker count under load. Below 16 workers, neither system is in trouble. Above 32, only one of them is.
Repo with raw data, scripts, and full methodology: https://github.com/saucebase-dev/nwidart-x-internachi
Previous post: https://www.reddit.com/r/laravel/comments/1t0pcbe/i_benchmarked_laravels_two_main_module_systems/
Links:
internachi/modular: https://github.com/InterNACHI/modular
nwidart/laravel-modules: https://github.com/nWidart/laravel-modules
Filament modular architecture docs: https://filamentphp.com/docs/5.x/advanced/modular-architecture
Saucebase: https://github.com/saucebase-dev/saucebase
r/laravel • u/aarondf • Jan 16 '26
r/laravel • u/mertyildiran • Aug 18 '19
r/laravel • u/simonhamp • Nov 26 '25
The future of building mobile apps is almost upon us:
Run a command
Scan a QR code
And in seconds your #Laravel app is running on your phone
No compiling. No Apple/Google developer account. No Xcode or Android Studio. Not even a NativePHP license required!
Just your Laravel app, a small Composer package, and the Jump app installed on your phone.
NativePHP Jump — Coming Soon!
r/laravel • u/Prestigious-Yam2428 • Jan 26 '26
Hey r/laravel! Just wanted to share a big update from the LarAgent team: v1.0 is officially out now! 🎉
If you’ve been following LarAgent or looking into AI agents in Laravel, this release is a huge step toward making them production-ready and way easier to build and scale in real apps.
Here’s the rundown of the most exciting features:
🔹 Structured, typed outputs and tool props (DataModel) – No more guessing keys in arrays. Agents can now return predictable, schema-validated results you can rely on in real workflows.
🔹 Pluggable storage layer – Chat history/context can now live in database, cache, file, etc., and even fall back automatically.
🔹 Context truncation strategies – Smart sliding windows, summarization, or symbolic compression so long chats don’t blow up token usage.
🔹 Better session + identity support – Context scoped by user, agent, and group helps with multi-tenant apps.
🔹 MCP tool caching & usage tracking – Faster startup and built-in tracking for tokens/usage stats.
And... Breaking news! LarAgent is now backed by Redberry, one of only 10 Diamond-tier Laravel partners. This partnership allows LarAgent to scale development, get battle-tested in enterprise-grade projects and stay open-source
r/laravel • u/mccreaja • Feb 28 '23
r/laravel • u/christophrumpel • Jul 01 '25
r/laravel • u/Tilly-w-e • Jan 02 '25
In this short video I will walk you through the process of installing ShadCN with ReactJS and Laravel. The video is under 10 minutes.
r/laravel • u/dennsel_double_u • May 02 '23
r/laravel • u/aimeos • Apr 16 '26
We just released Pagible 0.10, an open-source AI-powered CMS built for Laravel developers:
MCP Server — Pagible ships with a built-in Model Context Protocol server. AI agents can create pages, manage content, and search your site programmatically. This makes Pagible one of the first CMS platforms where AI can directly manage your content through a standardized protocol.
Customizable architecture — The codebase has been split into 9 independent sub-packages (core, admin, AI, GraphQL, search, MCP, theme, etc.). Install only what you need.
Vuetify 4 admin panel — The admin backend has been upgraded to Vuetify 4 and optimized for WCAG accessibility, keyboard navigation and reduced bundle size.
Significant performance work — This release focused heavily on database performance: optimized indexes, reduced query count, eager loading, optimized column selection, and faster page tree fetching.
Rewritten fulltext search — Custom Scout engine supporting fulltext search in SQLite, MySQL/MariaDB, PostgreSQL, and SQL Server. Paginated results with improved relevance ranking.
Named roles & JSON permissions — Moved from bitmask permissions to a readable JSON array system with configurable roles (e.g. editor, publisher, viewer, etc).
Security hardening — Rate limiting on all endpoints, strict security, DoS protection against all inputs.
Laravel-native — Not a CMS bolted onto Laravel. It uses Blade, Eloquent, migrations, Scout, service providers — everything you already know.
AI-first — MCP server for agent-driven content management, plus built-in AI features for content generation, translation, and image manipulation via Prism/Prisma.
Hierarchical pages — Nested set tree structure with versioning. Editors see drafts, visitors see published content.
Multi-tenant — Global tenant scoping on all models out of the box.
Small footprint — The entire codebase is deliberately kept small. No bloat, no unnecessary abstractions.
LGPL-3.0 — Fully open source.
Website: https://pagible.com/laravel-cms
Would love to hear your feedback and if you like it, give a star :-)
r/laravel • u/Meenctg • Oct 31 '19
r/laravel • u/simonhamp • Apr 30 '24
r/laravel • u/christophrumpel • Jun 29 '26
The Laravel AI SDK now supports sub agents, and they open up a really nice way to split complex AI tasks into smaller specialized agents.
r/laravel • u/EvilPainter • May 11 '17
r/laravel • u/mccreaja • May 19 '26
A quick demo of AI skills and commands that automate the entire Shift process right from your prompt - providing the most thorough, automated Laravel upgrade.
Follow the Shift AI README to install these skills and commands.
r/laravel • u/mccreaja • Apr 29 '26
In this video, I demo upgrading laravelshift.com to Laravel 13 using the new /upgrade skill and Shift. This highlights the best of both tools to provide the most thorough, automated upgrade.
tl;dw; The skill relies on AI. So no two runs are alike. Shift's goal is to make your application "look and feel" like it's been running Laravel 13. So its bar is higher. Using both provide the most thorough, automated upgraded.
Note: this video was clipped to meet Reddit's 15 minute time limit. You may watch the full video on YouTube to see me run the Livewire 4.x Shift and get everything passing.
r/laravel • u/tylernathanreed • Jun 14 '23
r/Laravel recently went private as part of a joint protest to Reddit's recent API changes, which breaks 3rd party apps and moderation tools. To learn more about this, visit r/Save3rdPartyApps.
We appreciate everyone's patience and understanding during this time, as we know that not having access to this subreddit was a burden to many people.
Several subreddits are still dark in a continued protest to support 3rd party apps that offer accessibility features that the official app does not.
After a recent discussion, we decided to only go dark for the recommended two days. We have not made any decisions to go back to private and continue our support in the protest. We felt that it was important to gather community feedback before making such a decision.
Please let us know, as a comment on this post, if you do, or do not, want r/Laravel to go back to private and directly support the protest again, and for how long. While we support the efforts of the protest, we also understand that making r/Laravel private negatively impacts our community in the short term.
r/laravel • u/__neone • Dec 23 '22
Example prompt:
laravel migration for a message class that is deleted when the associated user account is deleted
Generated Code:
public function up()
{
Schema::create('messages', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('user_id');
$table->text('message');
$table->timestamps();
$table->foreign('user_id')
->references('id')
->on('users')
->onDelete('cascade');
});
}Another example:
laravel migration for user with first name, last name, user name (unique), opt-in for digest, digest delivery period, last sent email time
Generated code:
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('first_name');
$table->string('last_name');
$table->string('user_name')->unique();
$table->boolean('opt_in_for_digest')->default(false);
$table->string('digest_delivery_period')->nullable();
$table->timestamp('last_sent_email_time')->nullable();
$table->timestamps();
});
}Run it yourself, also gives you the artisan commands to run, and explains what is going, what a cascade delete is, etc. This is mind-blowingly good, and unless you're just an amazing pro I would incorporate using ChatGPT in your code writing (I'm going to). Lots of these minor steps I would often skip due to being lazy and not wanting to write all the boiler plate code...
I will be including my prompts in my code so I can tweak/refine when needed.
Happy (not) coding!
r/laravel • u/dmaksimov • Feb 19 '22
Something I've been enjoying a lot lately is using Laravel's Eloquent ORM + Mongo DB for quickly spinning up prototypes. This is great when you're still experimenting with ideas and don't know exactly how the data will be modeled.
MongoDB is a NoSQL database and doesn't require a schema, meaning you don't have to worry about creating migrations up front. Just create the model, setup the relationships and you're ready to roll.
If you prefer to use SQL you can switch and make the migrations down the road once you know what your table structure will look like.
Not having to worry about the details like table structure while you're prototyping is a huge time saver.
There's a well maintained MongoDB package for Laravel by jenssegers/laravel-mongodb.
Note: there are some limitations on the relationships types that are supported.
r/laravel • u/Mobile_Edge5434 • Jun 07 '26
Running multiple coding agents in parallel git worktrees is great until two of them kick off the test suite at the same moment. RefreshDatabase is not polite — it will happily truncate tables mid-run on another worktree’s behalf and you end up chasing flaky failures that aren’t actually in your code at all.
--parallel doesn’t save you here either, by the way. It isolates workers within a single run but every worktree still shares the same base database name, so you’re right back to two processes scrapping over myapp-test_test_1.
The fix is a small PHP wrapper at bin/test that derives a per-worktree database name from the directory, provisions it if it’s missing (race-safe, via Postgres’ 42P04 handling), and then hands off to artisan with pcntl_exec so exit codes and signals all behave normally. It’s gated behind a single toggle in .env.testing and off by default — CI doesn’t know it exists.
There are also some deliberately paranoid guards: the derived name has to contain the string test or the run aborts outright, because the failure mode otherwise is RefreshDatabase eating your local development data.
Full writeup with the complete wrapper, the TestDatabaseResolver class, and the belt-and-braces safety checks: https://www.mojowill.com/developer/a-test-database-per-worktree/