<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by PHP Nerd on Medium]]></title>
        <description><![CDATA[Stories by PHP Nerd on Medium]]></description>
        <link>https://medium.com/@php.nerd?source=rss-26b4cc8c5595------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7gSMWKeytGbEnXlYpce5aw.png</url>
            <title>Stories by PHP Nerd on Medium</title>
            <link>https://medium.com/@php.nerd?source=rss-26b4cc8c5595------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 13 Nov 2026 21:58:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@php.nerd/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Best PHP APM Tools in 2026]]></title>
            <link>https://medium.com/@php.nerd/best-php-apm-tools-in-2026-2f5232919bf0?source=rss-26b4cc8c5595------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f5232919bf0</guid>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[php-developers]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[symfony]]></category>
            <category><![CDATA[php-development]]></category>
            <dc:creator><![CDATA[PHP Nerd]]></dc:creator>
            <pubDate>Thu, 21 May 2026 11:16:18 GMT</pubDate>
            <atom:updated>2026-05-21T11:16:18.471Z</atom:updated>
            <content:encoded><![CDATA[<p>Choosing a PHP APM tool in 2026 is harder than it should be.</p><p>Most products now claim to offer “application performance monitoring”, “distributed tracing”, “profiling”, “observability”, “error monitoring”, or some combination of all five. But those words do not always mean the same thing.</p><p>Some tools genuinely hook into the PHP runtime and show you what your application did at method, function, query, template, queue-job, or framework level. Others are closer to event collectors: they receive spans, errors, metrics, or emitted events, then wrap those events in dashboards. Both approaches can be useful, but they solve different problems.</p><p>If your question is:</p><blockquote>“Which service is slow?”</blockquote><p>A general APM or observability platform may be enough.</p><p>If your question is:</p><blockquote>“Which PHP method, query, framework call, middleware, template render, or queue job made this request slow?”</blockquote><p>You need something deeper than a glorified event wrapper.</p><p>That distinction is the core of this guide.</p><p>Below, we compare the best PHP APM tools in 2026, including New Relic, Datadog, Sentry, Scout APM, Tideways, Blackfire, Elastic APM, Pinpoint, Instana, and Perfbase.</p><h2>Quick answer: the best PHP APM tools in 2026</h2><p>The strongest PHP APM tools in 2026 are:</p><p>If you only want the short version:</p><p><strong>Use Perfbase, Tideways, or Blackfire if PHP performance is the main thing you care about.</strong></p><p>Use <strong>Datadog, New Relic, Elastic, or Instana</strong> if PHP is only one part of a wider multi-language platform.</p><p>Use <strong>Sentry</strong> if error tracking and developer workflow are just as important as performance.</p><p>Use <strong>Scout APM</strong> if you want a lighter, friendlier PHP monitoring product without the weight of a full observability suite.</p><h2>What makes a PHP APM tool good?</h2><p>A good PHP APM tool should do more than tell you that /checkout was slow.</p><p>It should help you understand why.</p><p>That means looking at:</p><ol><li><strong>Runtime depth</strong> Does the tool hook into PHP deeply enough to see functions, methods, database queries, framework internals, queue jobs, templates, and external calls?</li><li><strong>Tracing quality</strong> Can it show a request or job from start to finish, including database, cache, HTTP, queue, and background work?</li><li><strong>Profiling quality</strong> Can it show where CPU time, memory, and wall time were actually spent?</li><li><strong>Framework awareness</strong> Does it understand Laravel, Symfony, WordPress, Magento, Yii, CakePHP, Joomla, or custom PHP apps?</li><li><strong>Production safety</strong> Is the overhead low enough to leave enabled in production?</li><li><strong>Pricing clarity</strong> Are you paying per host, per seat, per span, per trace, per project, per user, or by some confusing combination?</li><li><strong>Data minimisation</strong> Does it avoid collecting request bodies, secrets, credentials, and sensitive payloads?</li><li><strong>APM honesty</strong> Is it truly observing PHP execution, or mostly displaying events your code or SDK emitted?</li></ol><p>That last point matters.</p><p>A product can have nice dashboards and still be shallow. If it only shows spans that were manually emitted, it may help you see the broad shape of a request, but it will not necessarily show the PHP runtime-level truth.</p><p>For PHP teams, the best APM tools are usually the ones that combine tracing with profiling.</p><h2>PHP APM depth comparison</h2><p>Here is the most important table in this article.</p><p>This does not mean Datadog or New Relic are weak products. They are excellent platforms. But they are not built around PHP in the same way that Perfbase, Tideways, or Blackfire are.</p><p>That is the core buying decision:</p><p><strong>Do you want a broad observability platform that also supports PHP, or a PHP performance tool built specifically around how PHP applications actually run?</strong></p><h2>1. Perfbase</h2><p><strong>Best for:</strong> PHP teams that want proper runtime-level performance insight without enterprise observability bloat.</p><p><a href="https://perfbase.com"><strong>Perfbase</strong></a> is a PHP-focused APM and profiling tool built for teams that care about what happens inside their PHP applications.</p><p>Unlike tools that mostly rely on emitted spans or high-level transaction events, Perfbase is designed around native PHP profiling. It hooks into the runtime, captures call-level execution data, and turns that into flamegraphs, call trees, slow query views, memory analysis, CPU analysis, and request-level traces.</p><p>That makes it especially useful when you need to answer questions like:</p><ul><li>Which method caused this request to slow down?</li><li>Which database query is repeated too often?</li><li>Is this a Laravel middleware issue, an Eloquent issue, a view rendering issue, or a third-party HTTP call?</li><li>Which part of this queue job is actually expensive?</li><li>Did this deployment make a specific code path slower?</li></ul><p>Perfbase supports modern PHP versions, common frameworks, and custom PHP applications. It is also priced per project rather than per host, per seat, or per span, which makes it easier to reason about cost.</p><p>That matters because PHP infrastructure is often messy. You may have multiple servers, workers, queues, staging environments, and cron workloads. Per-host APM pricing can become painful quickly. Per-project pricing is much easier for PHP teams to understand.</p><h3>Where Perfbase is strongest</h3><p>Perfbase is strongest when you want PHP-native visibility.</p><p>It is not trying to be a giant observability platform for every language, cloud, container, log line, browser session, and security event. That is a feature, not a weakness, if your main problem is PHP performance.</p><p>Perfbase is especially strong for:</p><ul><li>PHP SaaS applications</li><li>Laravel applications</li><li>Symfony applications</li><li>WordPress and CMS-heavy systems</li><li>Custom PHP platforms</li><li>Agencies managing multiple PHP projects</li><li>Teams that care about profiling, not just dashboards</li><li>Teams that want low overhead and simple pricing</li></ul><h3>How much of an APM is Perfbase?</h3><p>Perfbase scores highly here.</p><p>It is not just a wrapper around manually emitted events. It is closer to a true PHP runtime profiler and APM hybrid. It shows what the PHP application actually did, not merely what the developer remembered to instrument.</p><p>That makes it one of the more serious options if your definition of APM includes “show me the code path that caused the slowdown”.</p><h3>Perfbase pros</h3><ul><li>PHP-native runtime-level visibility</li><li>Flamegraphs and call trees</li><li>Database query analysis</li><li>Memory and CPU profiling</li><li>Useful for Laravel, Symfony, WordPress, and custom PHP</li><li>Predictable per-project pricing</li><li>Strong fit for production performance debugging</li><li>Less bloated than general observability platforms</li></ul><h3>Perfbase cons</h3><ul><li>Newer than incumbents like New Relic, Datadog, Blackfire, and Tideways</li><li>Less public third-party validation than older tools</li><li>Not designed to replace a whole-company observability platform</li><li>Not the obvious choice if you need Kubernetes, infrastructure, logs, RUM, security, and APM in one vendor</li></ul><h3>Verdict</h3><p>Perfbase is one of the best PHP APM tools in 2026 if your main goal is to understand PHP performance at code level.</p><p>It is especially compelling for teams that look at general APM dashboards and think:</p><blockquote>“This tells me the request was slow, but not enough about why.”</blockquote><p>For PHP-first teams, Perfbase should be on the shortlist.</p><h2>2. Tideways</h2><p><strong>Best for:</strong> Mature PHP production observability.</p><p>Tideways is one of the strongest established PHP-specific APM tools.</p><p>It has a long history in the PHP ecosystem and is built around production tracing, framework awareness, bottleneck detection, and application-level insight. Tideways is especially relevant for teams running Laravel, Symfony, Shopware, Magento, WordPress, TYPO3, Laminas, Yii, CakePHP, Slim, or other PHP frameworks.</p><p>The key advantage of Tideways is that it understands PHP applications as PHP applications. It is not just ingesting generic telemetry and asking you to make sense of it yourself.</p><p>It can identify transactions, database calls, framework operations, external HTTP calls, queue work, and other common sources of production bottlenecks.</p><h3>How much of an APM is Tideways?</h3><p>Very much so.</p><p>Tideways is not merely an event dashboard. It is a PHP-native production performance tool with tracing and profiling roots. It has enough runtime and framework awareness to be considered a real PHP APM, not a generic tracing wrapper.</p><h3>Tideways pros</h3><ul><li>Strong PHP-native instrumentation</li><li>Mature production tracing</li><li>Broad framework support</li><li>Good fit for Laravel, Symfony, Magento, Shopware, WordPress, and TYPO3</li><li>Clearer PHP focus than most generalist platforms</li><li>Good for finding bottlenecks in real production traffic</li></ul><h3>Tideways cons</h3><ul><li>Narrower than Datadog or New Relic outside PHP</li><li>Less useful if your estate is mostly non-PHP</li><li>Retention and pricing may not suit every team</li><li>Not as broad a general observability suite as enterprise platforms</li></ul><h3>Verdict</h3><p>Tideways is one of the safest choices for PHP teams that want mature production APM without buying into a huge general-purpose observability platform.</p><p>If you are comparing PHP-native tools, Tideways should be compared directly with Perfbase and Blackfire.</p><h2>3. Blackfire</h2><p><strong>Best for:</strong> Deep profiling, performance testing, and optimisation workflows.</p><p>Blackfire is one of the best-known PHP performance tools. It is especially strong as a profiler.</p><p>Blackfire helps developers inspect performance profiles, compare runs, enforce performance assertions, and build optimisation workflows into development and CI/CD. It is commonly used by teams that treat performance as an engineering discipline rather than something they only inspect after production incidents.</p><p>Blackfire also offers monitoring and continuous profiling features, but its centre of gravity is still profiling. That is not a criticism. In fact, for many PHP teams, profiling is exactly what they need.</p><h3>How much of an APM is Blackfire?</h3><p>Blackfire is a serious performance tool, but it is more profiler-first than classic APM-first.</p><p>It can monitor and profile production applications, but its biggest strength is helping engineers understand and improve code-level performance. If you want error inboxes, infrastructure monitoring, logs, RUM, and broad dashboards, Blackfire is not the obvious first pick. If you want deep PHP profiling, it is one of the best tools available.</p><h3>Blackfire pros</h3><ul><li>Excellent PHP profiling</li><li>Strong flamegraph and call-level performance analysis</li><li>Great for optimisation workflows</li><li>Useful in development, staging, CI, and production</li><li>Performance assertions and testing are valuable for serious teams</li><li>Deep PHP ecosystem credibility</li></ul><h3>Blackfire cons</h3><ul><li>Production pricing can be high for smaller teams</li><li>More profiler-first than error/APM-first</li><li>Less suited to broad observability needs</li><li>May be more tool than a small team needs if they only want simple monitoring</li></ul><h3>Verdict</h3><p>Blackfire is one of the best PHP profiling tools in the world.</p><p>As a PHP APM tool, it is strongest when your team wants to diagnose and prevent performance regressions in a disciplined way. It is less ideal if you want a simple, always-on SaaS APM with straightforward pricing.</p><h2>4. New Relic</h2><p><strong>Best for:</strong> Enterprise APM across many languages and services.</p><p>New Relic is one of the oldest and most recognisable names in APM.</p><p>Its PHP agent supports modern PHP versions and common PHP frameworks. It gives you transaction traces, errors, dashboards, distributed tracing, service maps, logs in context, infrastructure correlation, and many of the workflows expected from a mature APM platform.</p><p>For larger teams, New Relic’s main strength is not PHP-specific depth. It is platform maturity.</p><p>If your organisation already uses New Relic for Java, Node.js, Go, Python, Kubernetes, browser monitoring, infrastructure, logs, and alerting, then adding PHP applications to the same platform can make sense.</p><h3>How much of an APM is New Relic?</h3><p>New Relic is absolutely a real APM.</p><p>But for PHP specifically, it is more of a broad APM platform with PHP support than a PHP-native profiler. It can tell you a lot about transactions, errors, databases, external calls, and service behaviour, but it is not as focused on PHP runtime-level profiling as Perfbase, Tideways, or Blackfire.</p><h3>New Relic pros</h3><ul><li>Mature APM product</li><li>Broad language and platform support</li><li>Good enterprise workflows</li><li>Strong dashboards and alerting</li><li>Useful distributed tracing</li><li>Good fit for large organisations</li></ul><h3>New Relic cons</h3><ul><li>Pricing can be harder to reason about</li><li>Less PHP-native than specialist tools</li><li>Can feel heavy for small PHP teams</li><li>Not the best choice if your only problem is PHP code-level performance</li></ul><h3>Verdict</h3><p>New Relic is a strong choice when PHP is one part of a larger engineering estate.</p><p>For PHP-only teams, it may be more platform than you need.</p><h2>5. Datadog</h2><p><strong>Best for:</strong> Full-stack observability.</p><p>Datadog is one of the most complete observability platforms available.</p><p>It covers APM, infrastructure, logs, metrics, synthetics, real user monitoring, security monitoring, cloud cost visibility, database monitoring, incident workflows, and a huge integration ecosystem.</p><p>For PHP teams inside larger companies, Datadog can be extremely useful because it connects application traces to infrastructure, containers, databases, cloud services, logs, and alerts.</p><p>If your PHP application runs in Kubernetes, talks to Redis and MySQL, emits logs, depends on external APIs, and is part of a larger platform, Datadog can give you a joined-up view.</p><h3>How much of an APM is Datadog?</h3><p>Datadog is a real APM, but it is not PHP-native in the same way that Perfbase, Tideways, or Blackfire are.</p><p>It is better described as a full observability platform with PHP tracing support. It is excellent for seeing how systems interact. It is less focused on being a PHP runtime profiler.</p><h3>Datadog pros</h3><ul><li>Huge observability platform</li><li>Strong infrastructure and service correlation</li><li>Excellent integrations</li><li>Good distributed tracing</li><li>Useful for complex production environments</li><li>Strong enterprise adoption</li></ul><h3>Datadog cons</h3><ul><li>Pricing can grow quickly</li><li>Can be too broad for PHP-only teams</li><li>Requires careful setup to avoid noisy dashboards</li><li>Less focused on PHP code-level performance than specialist tools</li></ul><h3>Verdict</h3><p>Datadog is one of the best choices if your company wants one observability platform for everything.</p><p>It is not the most PHP-native option, but it may be the strongest platform option.</p><h2>6. Sentry</h2><p><strong>Best for:</strong> Developer-first error monitoring with tracing and profiling.</p><p>Sentry started as error monitoring, but it has grown into a much broader developer observability platform.</p><p>For PHP teams, Sentry can now handle errors, performance monitoring, tracing, profiling, releases, issue ownership, and alerting. It is especially good when your developers want to move from “something broke” to “which release caused it?” quickly.</p><p>Sentry’s biggest advantage is workflow. It is one of the most developer-friendly tools on this list.</p><h3>How much of an APM is Sentry?</h3><p>Sentry is a real monitoring product, but it is still error-first and developer-workflow-first.</p><p>Its tracing and profiling features make it much more APM-like than it used to be, but it is not as deeply PHP-native as tools built specifically around PHP profiling.</p><p>For many teams, that is fine. If your biggest pain is errors, regressions, and slow endpoints tied to releases, Sentry can be a very good fit.</p><h3>Sentry pros</h3><ul><li>Excellent error tracking</li><li>Strong developer workflow</li><li>Useful tracing and profiling</li><li>Good release correlation</li><li>Friendly UI</li><li>Works across many languages</li><li>Can be self-hosted</li></ul><h3>Sentry cons</h3><ul><li>Not as PHP-specific as Tideways, Perfbase, or Blackfire</li><li>Usage-based pricing needs monitoring</li><li>Less suitable as a full infrastructure observability suite</li><li>Profiling depth may not satisfy teams that want full runtime-level PHP analysis</li></ul><h3>Verdict</h3><p>Sentry is one of the best tools for product teams that care about errors and performance together.</p><p>It is not the deepest PHP APM, but it may be the most useful day-to-day debugging tool for many development teams.</p><h2>7. Scout APM</h2><p><strong>Best for:</strong> Simple, developer-friendly PHP monitoring.</p><p>Scout APM is a lighter alternative to New Relic and Datadog.</p><p>It focuses on application performance, traces, slow database queries, N+1 query detection, memory bloat, errors, and developer-friendly views. It has good support for Laravel and Symfony, and is generally easier to adopt than a large observability platform.</p><p>Scout is particularly appealing if your team wants useful PHP performance monitoring without the weight, pricing complexity, or configuration overhead of a larger platform.</p><h3>How much of an APM is Scout APM?</h3><p>Scout is a real APM, and it has useful PHP-specific instrumentation.</p><p>It does not feel as deeply profiler-first as Blackfire, Tideways, or Perfbase, but it gives more practical PHP-level insight than many generic tools. For many Laravel and Symfony teams, that middle ground is attractive.</p><h3>Scout APM pros</h3><ul><li>Simple to understand</li><li>Good Laravel and Symfony support</li><li>Useful N+1 and memory bloat detection</li><li>More approachable than large observability platforms</li><li>Developer-friendly</li><li>Clearer pricing than many competitors</li></ul><h3>Scout APM cons</h3><ul><li>Less broad than Datadog or New Relic</li><li>Less profiler-heavy than Perfbase, Tideways, or Blackfire</li><li>Not ideal for huge multi-language observability estates</li><li>PHP version and framework support should be checked against your stack</li></ul><h3>Verdict</h3><p>Scout APM is a strong choice for PHP teams that want useful monitoring quickly.</p><p>It is not the deepest profiling tool, but it is practical, focused, and easier to adopt than many enterprise platforms.</p><h2>8. Elastic APM</h2><p><strong>Best for:</strong> Teams already using Elastic, or teams that want self-hosted observability.</p><p>Elastic APM is part of the Elastic Stack. If your team already uses Elasticsearch, Kibana, Elastic Observability, or Elastic Cloud, then Elastic APM is a natural option.</p><p>It supports PHP through the Elastic APM PHP agent and can connect traces, logs, metrics, and service data inside the Elastic ecosystem.</p><p>Elastic’s biggest advantage is deployment flexibility. You can use Elastic Cloud, serverless options, or self-managed infrastructure depending on your requirements.</p><h3>How much of an APM is Elastic APM?</h3><p>Elastic APM is a real APM, especially when used as part of the wider Elastic Observability stack.</p><p>For PHP specifically, it is more of a general tracing/APM product than a PHP-native profiler. It is useful for service-level visibility, but less compelling if your main need is deep PHP function-level analysis.</p><h3>Elastic APM pros</h3><ul><li>Good option for Elastic users</li><li>Self-managed option available</li><li>Connects traces, logs, and metrics</li><li>Flexible retention and deployment models</li><li>Strong fit for teams with existing Elastic expertise</li></ul><h3>Elastic APM cons</h3><ul><li>More operational work if self-hosted</li><li>Less PHP-native than specialist tools</li><li>Setup and data modelling can be more involved</li><li>Not the simplest choice for small PHP teams</li></ul><h3>Verdict</h3><p>Elastic APM is a good choice if you already use Elastic or want more control over your observability stack.</p><p>It is not the first tool I would choose purely for PHP code-level profiling.</p><h2>9. Pinpoint</h2><p><strong>Best for:</strong> Open-source distributed tracing.</p><p>Pinpoint is an open-source APM and distributed tracing platform. PHP support exists through its C agent and related ecosystem packages.</p><p>The appeal is obvious: open-source, self-hosted, and not tied to SaaS pricing.</p><p>The trade-off is also obvious: you take on more operational responsibility. Documentation, polish, compatibility clarity, retention, and ease of use may not match commercial PHP-focused tools.</p><h3>How much of an APM is Pinpoint?</h3><p>Pinpoint is a real distributed tracing platform.</p><p>For PHP specifically, it is less polished and less obviously PHP-native than Perfbase, Tideways, Blackfire, or Scout. It is better suited to teams that have platform engineering capacity and want control over their tooling.</p><h3>Pinpoint pros</h3><ul><li>Open-source</li><li>Self-hosted</li><li>Distributed tracing focus</li><li>No SaaS lock-in</li><li>Flexible for teams willing to operate it</li></ul><h3>Pinpoint cons</h3><ul><li>More operational burden</li><li>PHP support is less productised</li><li>Less transparent compatibility information</li><li>Less polished than commercial tools</li><li>Not ideal for teams that want quick onboarding</li></ul><h3>Verdict</h3><p>Pinpoint can make sense for engineering-heavy teams that want open-source tracing.</p><p>Most PHP product teams will be better served by a commercial PHP-focused APM.</p><h2>10. Instana</h2><p><strong>Best for:</strong> Existing IBM/Instana environments.</p><p>Instana is an enterprise observability platform now under IBM. It supports application monitoring across many technologies and can fit companies that already use IBM tooling or have standardised around Instana.</p><p>For PHP buyers, Instana is harder to recommend as a standalone first choice. Public PHP-specific detail is less compelling than New Relic, Datadog, Tideways, Blackfire, Scout, Sentry, or Perfbase.</p><p>Instana may still make sense if your organisation has already chosen it as the standard observability platform.</p><h3>How much of an APM is Instana?</h3><p>Instana is a real enterprise APM platform.</p><p>For PHP specifically, it is better thought of as a platform-level observability choice than a PHP-native performance tool. If you are buying specifically for PHP code-level insight, there are stronger options.</p><h3>Instana pros</h3><ul><li>Enterprise observability platform</li><li>Useful in IBM-centric environments</li><li>Suitable for large organisations</li><li>OpenTelemetry direction may appeal to some teams</li></ul><h3>Instana cons</h3><ul><li>Less PHP-specific public clarity</li><li>Likely overkill for small PHP teams</li><li>Not the strongest PHP-native profiler</li><li>Usually requires a broader platform buying decision</li></ul><h3>Verdict</h3><p>Instana is worth considering if your company already uses it.</p><p>It is not the obvious first choice for a PHP team independently choosing the best PHP APM tool.</p><h2>General APM vs PHP-native APM</h2><p>The biggest mistake teams make is comparing all APM tools as if they are the same category.</p><p>They are not.</p><p>There are two broad categories:</p><h3>General observability platforms</h3><p>These include:</p><ul><li>Datadog</li><li>New Relic</li><li>Elastic APM</li><li>Instana</li></ul><p>They are good at:</p><ul><li>Distributed tracing</li><li>Infrastructure correlation</li><li>Logs and metrics</li><li>Multi-language environments</li><li>Dashboards</li><li>Alerting</li><li>Governance</li><li>Enterprise workflows</li></ul><p>They are less good at:</p><ul><li>Deep PHP runtime-level profiling</li><li>Explaining exactly which PHP method was expensive</li><li>Showing PHP-specific framework internals in detail</li><li>Giving small PHP teams simple pricing</li></ul><h3>PHP-native performance tools</h3><p>These include:</p><ul><li>Perfbase</li><li>Tideways</li><li>Blackfire</li><li>Scout APM, to a lesser extent</li></ul><p>They are good at:</p><ul><li>PHP runtime visibility</li><li>Framework-aware traces</li><li>Flamegraphs</li><li>Call trees</li><li>Slow query diagnosis</li><li>N+1 detection</li><li>Memory and CPU analysis</li><li>Code-level bottleneck discovery</li></ul><p>They are less good at:</p><ul><li>Whole-company observability</li><li>Infrastructure-wide dashboards</li><li>Security monitoring</li><li>Multi-language governance</li><li>Centralised log analytics</li></ul><p>Neither category is universally better.</p><p>But if your goal is to improve PHP performance, PHP-native tools usually get you to the answer faster.</p><h2>Which PHP APM tool should you choose?</h2><h3>Choose Perfbase if…</h3><p>Choose Perfbase if you want a modern PHP-native APM that focuses on runtime-level profiling, clear traces, flamegraphs, call trees, database query analysis, and simple pricing.</p><p>Perfbase is especially compelling if you are tired of generic dashboards that show symptoms but not causes.</p><p>Best for:</p><ul><li>PHP-first teams</li><li>Laravel teams</li><li>Symfony teams</li><li>WordPress/CMS teams</li><li>Agencies</li><li>SaaS teams</li><li>Teams that care about profiling</li><li>Teams that dislike per-host or per-seat pricing</li></ul><h3>Choose Tideways if…</h3><p>Choose Tideways if you want a mature PHP-native production monitoring tool with broad framework support and a long track record.</p><p>Best for:</p><ul><li>Established PHP businesses</li><li>Ecommerce platforms</li><li>Symfony/Laravel/Magento/Shopware/WordPress teams</li><li>Teams that want production tracing with PHP context</li></ul><h3>Choose Blackfire if…</h3><p>Choose Blackfire if you want deep profiling, performance testing, and optimisation workflows.</p><p>Best for:</p><ul><li>Performance-focused engineering teams</li><li>Teams using CI/CD performance assertions</li><li>Developers who want to compare profiles</li><li>Organisations that treat performance as a discipline</li></ul><h3>Choose Datadog if…</h3><p>Choose Datadog if PHP is only one part of a larger platform and you want one observability tool across infrastructure, logs, traces, security, cloud, and services.</p><p>Best for:</p><ul><li>Enterprises</li><li>Platform teams</li><li>Kubernetes-heavy environments</li><li>Multi-language estates</li><li>Teams with observability budgets</li></ul><h3>Choose New Relic if…</h3><p>Choose New Relic if you want mature APM workflows and broad platform coverage, especially if your organisation already uses New Relic.</p><p>Best for:</p><ul><li>Mature engineering organisations</li><li>Multi-service applications</li><li>Teams that want established APM workflows</li><li>Companies already invested in New Relic</li></ul><h3>Choose Sentry if…</h3><p>Choose Sentry if errors, releases, tracing, and developer workflow are your biggest concerns.</p><p>Best for:</p><ul><li>Product teams</li><li>SaaS teams</li><li>Teams that care about issue triage</li><li>Developers who want errors and performance together</li></ul><h3>Choose Scout APM if…</h3><p>Choose Scout if you want a simpler PHP-friendly APM that is easier to adopt than a full observability platform.</p><p>Best for:</p><ul><li>Laravel teams</li><li>Symfony teams</li><li>Smaller engineering teams</li><li>Teams wanting practical performance monitoring without complexity</li></ul><h3>Choose Elastic APM if…</h3><p>Choose Elastic APM if you already use Elastic or want a self-managed observability stack.</p><p>Best for:</p><ul><li>Elastic users</li><li>Teams with internal platform expertise</li><li>Self-hosted observability</li><li>Custom retention requirements</li></ul><h3>Choose Pinpoint if…</h3><p>Choose Pinpoint if you specifically want open-source distributed tracing and are happy to operate the platform yourself.</p><p>Best for:</p><ul><li>Platform-heavy teams</li><li>Open-source-first organisations</li><li>Teams with internal observability expertise</li></ul><h3>Choose Instana if…</h3><p>Choose Instana if your company already uses IBM/Instana or has standardised around it.</p><p>Best for:</p><ul><li>IBM-centric enterprises</li><li>Existing Instana users</li><li>Teams following a platform-level observability mandate</li></ul><h2>The best PHP APM tool overall</h2><p>For PHP-specific performance work, the best options are:</p><ol><li><strong>Perfbase</strong></li><li><strong>Tideways</strong></li><li><strong>Blackfire</strong></li><li><strong>Scout APM</strong></li></ol><p>For broad observability, the best options are:</p><ol><li><strong>Datadog</strong></li><li><strong>New Relic</strong></li><li><strong>Elastic APM</strong></li><li><strong>Instana</strong></li></ol><p>For developer-first debugging, the best option is:</p><ol><li><strong>Sentry</strong></li></ol><p>The most important thing is to be honest about what you are buying.</p><p>A broad observability platform may give you a beautiful dashboard and still leave you guessing which PHP method caused the slowdown.</p><p>A PHP-native profiler may not replace your infrastructure monitoring, but it may solve your actual performance problem much faster.</p><p>If you are running a serious PHP application, you probably want runtime-level insight, not just emitted events.</p><p>That is why tools like <a href="http://perfbase.com">Perfbase</a>, Tideways, and Blackfire deserve special attention in any PHP APM comparison.</p><h2>FAQ</h2><h3>What is the best PHP APM tool in 2026?</h3><p>The best PHP APM tool depends on what you need.</p><p>For PHP-native performance profiling, <a href="https://perfbase.com"><strong>Perfbase</strong></a>, <strong>Tideways</strong>, and <strong>Blackfire</strong> are the strongest options.</p><p>For broad enterprise observability, <strong>Datadog</strong> and <strong>New Relic</strong> are stronger.</p><p>For developer-first error monitoring with performance features, <strong>Sentry</strong> is an excellent choice.</p><h3>What is the difference between APM and profiling?</h3><p>APM tells you which transactions, services, endpoints, jobs, or dependencies are slow.</p><p>Profiling tells you what the code was doing inside that slow transaction.</p><p>For PHP teams, profiling is often the missing piece. A trace might tell you that /checkout took 900ms. A profile can show that 520ms was spent inside a specific method, ORM call, template render, or repeated database query.</p><h3>Are all APM tools real profilers?</h3><p>No.</p><p>Some APM tools are mostly based on traces, spans, metrics, logs, or emitted events. They can be useful, but they may not show function-level runtime behaviour.</p><p>If you want deep PHP performance insight, look for tools that support flamegraphs, call trees, runtime hooks, database query analysis, memory profiling, and CPU profiling.</p><h3>Is Datadog good for PHP?</h3><p>Yes, Datadog is good for PHP if you want PHP traces inside a wider observability platform.</p><p>It is especially useful if you also care about infrastructure, logs, containers, databases, security, and cloud services.</p><p>But if your main goal is PHP code-level profiling, a PHP-native tool may be a better fit.</p><h3>Is New Relic good for PHP?</h3><p>Yes. New Relic has mature PHP APM support and is a strong choice for larger teams.</p><p>However, it is a general APM platform rather than a PHP-specific profiler. It may be more than you need if you only want to diagnose PHP bottlenecks.</p><h3>Is Sentry an APM tool?</h3><p>Sentry is increasingly an APM-like platform, especially now that it combines error monitoring, tracing, profiling, releases, and issue workflow.</p><p>It is strongest for developer debugging rather than deep PHP runtime profiling.</p><h3>Is Blackfire an APM or a profiler?</h3><p>Blackfire is best understood as a profiler-first performance platform.</p><p>It includes monitoring and production features, but its biggest strength is deep profiling, performance comparison, and optimisation workflow.</p><h3>What is the best APM for Laravel?</h3><p>For Laravel, the strongest options are:</p><ul><li><a href="https://perfbase.com"><strong>Perfbase</strong></a> for PHP-native profiling and runtime-level insight</li><li><strong>Tideways</strong> for mature PHP production observability</li><li><strong>Blackfire</strong> for deep profiling and optimisation</li><li><strong>Scout APM</strong> for simple Laravel-friendly monitoring</li><li><strong>Sentry</strong> for errors, releases, tracing, and developer workflow</li><li><strong>Datadog</strong> or <strong>New Relic</strong> for broader platform observability</li></ul><h3>What is the best APM for Symfony?</h3><p>For Symfony, consider:</p><ul><li><a href="https://perfbase.com"><strong>Perfbase</strong></a></li><li><strong>Tideways</strong></li><li><strong>Blackfire</strong></li><li><strong>Scout APM</strong></li><li><strong>Sentry</strong></li><li><strong>Datadog</strong></li><li><strong>New Relic</strong></li></ul><p>The right choice depends on whether you want deep PHP profiling or broad observability.</p><h3>What is the best self-hosted PHP APM?</h3><p>The strongest self-hosted options are <strong>Elastic APM</strong>, <strong>Pinpoint</strong>, and self-hosted <strong>Sentry</strong>.</p><p>However, self-hosting usually means more operational work. If your goal is simply to improve PHP performance, a hosted PHP-native tool may be faster to adopt.</p><h2>Final recommendation</h2><p>If you are choosing a PHP APM tool in 2026, do not start with the vendor logo.</p><p>Start with the depth of visibility.</p><p>Ask:</p><blockquote>Does this tool actually understand what my PHP application is doing?</blockquote><p>If the answer is “it mostly shows emitted spans and dashboard events”, that may be enough for service-level observability.</p><p>But if you want to fix real PHP performance problems, you need deeper runtime-level insight.</p><p>For that reason, PHP-first teams should start their shortlist with <a href="https://perfbase.com"><strong>Perfbase</strong></a>, <strong>Tideways</strong>, and <strong>Blackfire</strong>.</p><p>Datadog and New Relic are excellent platforms, Sentry is excellent for developer workflow, Scout is a strong lightweight APM, and Elastic is a good self-hosted option.</p><p>But if the goal is to understand why PHP code is slow, the best tool is the one that can show what PHP actually executed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f5232919bf0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top PHP Laravel Authentication Libraries & Options for 2026]]></title>
            <link>https://medium.com/@php.nerd/top-php-laravel-authentication-libraries-options-for-2026-the-complete-decision-guide-e4c68039bf2e?source=rss-26b4cc8c5595------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4c68039bf2e</guid>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[php-developers]]></category>
            <category><![CDATA[php-development]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[laravel-framework]]></category>
            <dc:creator><![CDATA[PHP Nerd]]></dc:creator>
            <pubDate>Thu, 21 May 2026 11:08:58 GMT</pubDate>
            <atom:updated>2026-05-22T11:59:18.143Z</atom:updated>
            <content:encoded><![CDATA[<p>The Complete Decision Guide for your next Laravel project</p><h2>TL;DR</h2><ul><li><strong>For 90% of new Laravel 12/13 apps, start with an official Starter Kit (React, Vue, Svelte, or Livewire) — they ship Laravel Fortify, Sanctum, and now first-party passkeys out of the box.</strong> Reach for Laravel Sanctum for SPA and mobile API auth, Laravel Passport only when you must <em>be</em> an OAuth2 provider, and Laravel Socialite for “Sign in with Google/GitHub/Apple.”</li><li><strong>Breeze and Jetstream are officially in maintenance-only mode</strong> — Laravel’s 12.x release notes state they “will no longer receive additional updates.” They still work, but new projects should adopt the new Starter Kits (which use Fortify under the hood).</li><li><strong>Passkeys are now first-party.</strong> The laravel/passkeys package (currently v0.2.1, released May 18, 2026) plus Fortify&#39;s Features::passkeys() makes WebAuthn a one-line install. Pair with spatie/laravel-permission for roles, and you have a complete, modern auth stack with zero third-party dependencies.</li></ul><h2>Key Findings</h2><ol><li><strong>Laravel 12 (Feb 24, 2025) and Laravel 13 (released March 17, 2026, announced live by Taylor Otwell at Laracon EU 2026) reshaped the auth story.</strong> The old Breeze/Jetstream world has been replaced by stack-specific Starter Kits (React, Vue, Svelte, Livewire), and Laravel 13 brings native passkeys to Fortify and a redesigned Teams feature.</li><li><strong>Sanctum is now the default API stack</strong> for new Laravel apps. Its cookie-based SPA flow is more secure than localStorage tokens, and its personal-access-token mode covers mobile clients and “API key” use cases.</li><li><strong>Passport is no longer the default recommendation</strong> — it remains essential when you need a full OAuth2 server (i.e., when third parties need to log in <em>with your app</em>), but for first-party auth it’s overkill. Passport 13.x is now a headless OAuth2 library (its frontend views were removed and customization happens through Starter Kits).</li><li><strong>Fortify is the engine, not the UI.</strong> Every official Starter Kit uses Laravel Fortify under the hood. If you have a fully custom frontend (Inertia, Nuxt, mobile shell) but want Laravel-grade auth backends — registration, password reset, 2FA, email verification, passkeys — Fortify is the right primitive.</li><li><strong>The Laravel ecosystem has converged on a small, opinionated stack:</strong> Fortify (backend) + Sanctum (API/SPA tokens) + Socialite (OAuth clients) + Passkeys + Spatie Permission. You rarely need anything else.</li></ol><h2>Details: Every Laravel Authentication Option, Ranked and Explained</h2><h3>1. The New Laravel Starter Kits (React, Vue, Svelte, Livewire) — The Default in 2026</h3><p>When you run laravel new my-app in 2026, you&#39;re prompted to pick a Starter Kit. There are four official options:</p><ul><li><strong>React Starter Kit</strong> — Inertia 2, React 19, TypeScript, Tailwind, shadcn/ui</li><li><strong>Vue Starter Kit</strong> — Inertia 2, Vue 3, TypeScript, Tailwind, shadcn-vue</li><li><strong>Svelte Starter Kit</strong> — Inertia 2, Svelte 5, Tailwind, shadcn-svelte</li><li><strong>Livewire Starter Kit</strong> — Livewire 3, Volt, Tailwind, Flux UI</li></ul><p>Per Laravel’s official docs: <em>“The starter kits use Laravel Fortify to provide authentication.”</em> That means under the hood you get registration, login, password reset, email verification, 2FA, and (as of 2026) passkeys — all wired up. Each kit can also be installed in a <strong>WorkOS variant</strong> that adds enterprise SSO, social, and Magic Auth. The Laravel 12 release notes explicitly state: <em>“WorkOS offers free authentication for applications up to 1 million monthly active users.”</em></p><pre># Start a Laravel 13 project with the React Starter Kit<br>laravel new my-saas<br># choose: React → Inertia 2 → SSR? → Pest/PHPUnit → Yes/No WorkOS<br>cd my-saas &amp;&amp; composer dev</pre><p><strong>When to choose which kit?</strong></p><ul><li><em>Building a SaaS dashboard?</em> React or Vue with Inertia + SSR.</li><li><em>Don’t want a JS toolchain?</em> Livewire — write Blade + Volt, get reactivity, ship faster.</li><li><em>Want server-rendered with the smallest bundle?</em> Svelte.</li></ul><blockquote><strong>Senior-dev opinion:</strong> The Starter Kits are now the canonical “Hello Laravel” entry point. If you find yourself fighting them (shadcn opinionated styles, Flux’s paid Pro tier), reach for <strong>Fortify directly</strong> rather than rolling your own.</blockquote><h3>2. Laravel Fortify — Headless Authentication Backend</h3><p>Fortify is a frontend-agnostic auth backend. Per the official docs: <em>“Laravel Fortify is a frontend agnostic authentication backend implementation for Laravel. Fortify registers the routes and controllers needed to implement all of Laravel’s authentication features.”</em></p><p>It’s what every Starter Kit uses internally. Install it directly when you want Laravel’s auth routes (login, register, password reset, email verification, 2FA, passkeys) but plan to ship your own UI — typically a Nuxt/Next/Astro frontend, a mobile shell, or a heavily customized Blade theme.</p><pre>composer require laravel/fortify<br>php artisan vendor:publish --provider=&quot;Laravel\Fortify\FortifyServiceProvider&quot;<br>php artisan migrate</pre><p>Then in config/fortify.php, opt into the features you want:</p><pre>&#39;features&#39; =&gt; [<br>    Features::registration(),<br>    Features::resetPasswords(),<br>    Features::emailVerification(),<br>    Features::updateProfileInformation(),<br>    Features::updatePasswords(),<br>    Features::twoFactorAuthentication([&#39;confirm&#39; =&gt; true, &#39;confirmPassword&#39; =&gt; true]),<br>    Features::passkeys([&#39;confirmPassword&#39; =&gt; true]), // new in 2026<br>],</pre><p>Fortify exposes endpoints like POST /login, POST /register, POST /user/two-factor-authentication, POST /passkeys/login. Your UI calls them. Done.</p><blockquote><strong>When to use Fortify over a Starter Kit:</strong> You’re building a mobile-first product where the “frontend” is React Native, Flutter, or an existing JS app you don’t want to refactor into Inertia.</blockquote><h3>3. Laravel Sanctum — SPA Auth &amp; API Tokens, Lightweight</h3><p>Sanctum solves <strong>two distinct problems</strong>:</p><ol><li><strong>Cookie-based, session authentication for first-party SPAs</strong> (Vue/React/Svelte/Nuxt living on the same top-level domain as your Laravel API).</li><li><strong>Personal access tokens</strong> (“API keys”) for mobile apps and external integrations — GitHub-style.</li></ol><p>It does <em>not</em> implement OAuth2. That’s deliberate — it’s lean and security-friendly. Per the docs: <em>“Sanctum exists to offer a simple way to authenticate single page applications (SPAs) that need to communicate with a Laravel powered API… Sanctum does not use tokens of any kind. Instead, Sanctum uses Laravel’s built-in cookie based session authentication services. This provides the benefits of CSRF protection, session authentication, as well as protects against leakage of the authentication credentials via XSS.”</em></p><p><strong>SPA setup (the part everyone gets wrong):</strong></p><pre>composer require laravel/sanctum<br>php artisan install:api   # Laravel 11+: scaffolds Sanctum + statefulApi()</pre><pre>// bootstrap/app.php<br>-&gt;withMiddleware(function (Middleware $middleware) {<br>    $middleware-&gt;statefulApi();<br>})</pre><pre>APP_URL=https://api.example.com<br>SESSION_DOMAIN=.example.com<br>SANCTUM_STATEFUL_DOMAINS=app.example.com,localhost:3000<br>SESSION_SECURE_COOKIE=true<br>SESSION_SAME_SITE=lax</pre><pre>// config/cors.php<br>&#39;paths&#39; =&gt; [&#39;api/*&#39;, &#39;sanctum/csrf-cookie&#39;, &#39;login&#39;, &#39;logout&#39;],<br>&#39;allowed_origins&#39; =&gt; [&#39;https://app.example.com&#39;],<br>&#39;supports_credentials&#39; =&gt; true, // CRITICAL</pre><pre>// Frontend (axios) — get CSRF cookie, then log in<br>import axios from &#39;axios&#39;;<br>const api = axios.create({ baseURL: &#39;https://api.example.com&#39;, withCredentials: true });</pre><pre>await api.get(&#39;/sanctum/csrf-cookie&#39;);<br>await api.post(&#39;/login&#39;, { email, password });<br>const { data } = await api.get(&#39;/api/user&#39;); // authenticated!</pre><p><strong>Mobile / API token mode:</strong></p><pre>$user = User::where(&#39;email&#39;, $request-&gt;email)-&gt;first();<br>$token = $user-&gt;createToken(&#39;iphone-15&#39;, [&#39;read&#39;, &#39;write&#39;])-&gt;plainTextToken;<br>return [&#39;token&#39; =&gt; $token]; // store in iOS Keychain / Android Keystore</pre><p>Then on protected routes:</p><pre>Route::middleware(&#39;auth:sanctum&#39;)-&gt;get(&#39;/api/profile&#39;, fn (Request $r) =&gt; $r-&gt;user());</pre><blockquote><strong>Pitfall:</strong> SPA + Sanctum requires the SPA and API to share a top-level domain (subdomains are fine). If you’re cross-origin (e.g., frontend.vercel.app calling api.heroku.com), you&#39;ll either need to use token-based auth or proxy through the same domain.</blockquote><h3>4. Laravel Passport — Full OAuth2 Server (Only When You Really Need It)</h3><p>Passport is a full OAuth2 server built on league/oauth2-server. It supports Authorization Code, Client Credentials, Password Grant (deprecated in OAuth 2.1 — avoid in new code), Implicit (also deprecated), and refresh tokens. As of 2026, <strong>Passport 13.x is now headless</strong> — per the upgrade notes: <em>&quot;Passport is now a headless OAuth2 library. If you would like a frontend implementation of Laravel Passport&#39;s OAuth features that are already completed for you, you should use an application starter kit.&quot;</em></p><p>The official guidance (paraphrased from the docs): use Passport if your application absolutely needs OAuth2 — i.e., other applications need a “Sign in with [Your App]” button. Otherwise, use Sanctum.</p><p><strong>When you actually need Passport:</strong></p><ul><li>You’re building a developer platform (Stripe, GitHub, Slack–style) where third-party apps integrate with user accounts.</li><li>You need fine-grained scopes consumable by other OAuth2 clients.</li><li>Machine-to-machine (Client Credentials grant) between microservices.</li><li>OIDC / Single Sign-On where your Laravel app is the Identity Provider.</li></ul><p><strong>Setup:</strong></p><pre>composer require laravel/passport<br>php artisan migrate<br>php artisan passport:keys<br>php artisan passport:client --client   # client_credentials</pre><pre>// config/auth.php<br>&#39;guards&#39; =&gt; [<br>    &#39;api&#39; =&gt; [&#39;driver&#39; =&gt; &#39;passport&#39;, &#39;provider&#39; =&gt; &#39;users&#39;],<br>],</pre><pre>// User model<br>use Laravel\Passport\HasApiTokens;<br>class User extends Authenticatable { use HasApiTokens; }</pre><p><strong>Client Credentials grant (machine-to-machine):</strong></p><pre>curl -X POST https://api.example.com/oauth/token \<br>  -d &quot;grant_type=client_credentials&quot; \<br>  -d &quot;client_id=$CID&quot; \<br>  -d &quot;client_secret=$CSECRET&quot; \<br>  -d &quot;scope=read-billing&quot;</pre><blockquote><strong>Senior-dev opinion:</strong> Passport is wonderful when you need it and a foot-cannon when you don’t. I’ve seen multiple teams adopt Passport for “API auth” only to migrate to Sanctum a year later because they never used a single OAuth2 flow. Default to Sanctum until OAuth2 is a hard requirement.</blockquote><h3>5. Laravel Socialite — OAuth Client (Social Login)</h3><p>Socialite is the opposite of Passport: instead of <em>being</em> an OAuth provider, Socialite lets your Laravel app <em>consume</em> OAuth from external providers. Per the docs, it supports <em>“Facebook, X, LinkedIn, Google, GitHub, GitLab, Bitbucket, and Slack”</em> out of the box, with over 100 community adapters available at socialiteproviders.com (the SocialiteProviders GitHub organization hosts 296 repositories spanning Social/Platform, Gaming, and other provider categories, fetched May 21, 2026).</p><p><strong>Google login example (the most common scenario):</strong></p><pre>composer require laravel/socialite</pre><pre>// config/services.php<br>&#39;google&#39; =&gt; [<br>    &#39;client_id&#39; =&gt; env(&#39;GOOGLE_CLIENT_ID&#39;),<br>    &#39;client_secret&#39; =&gt; env(&#39;GOOGLE_CLIENT_SECRET&#39;),<br>    &#39;redirect&#39; =&gt; env(&#39;GOOGLE_REDIRECT_URL&#39;),<br>],</pre><pre>// routes/web.php<br>use Laravel\Socialite\Facades\Socialite;</pre><pre>Route::get(&#39;/auth/google&#39;,  fn () =&gt; Socialite::driver(&#39;google&#39;)-&gt;redirect());<br>Route::get(&#39;/auth/google/callback&#39;, function () {<br>    $g = Socialite::driver(&#39;google&#39;)-&gt;user();<br>    $user = User::updateOrCreate(<br>        [&#39;email&#39; =&gt; $g-&gt;email],<br>        [&#39;name&#39; =&gt; $g-&gt;name, &#39;google_id&#39; =&gt; $g-&gt;id, &#39;avatar&#39; =&gt; $g-&gt;avatar]<br>    );<br>    Auth::login($user, remember: true);<br>    return redirect(&#39;/dashboard&#39;);<br>});</pre><p>Migration columns to remember: provider_name, provider_id, provider_token (encrypted), provider_refresh_token (encrypted) — and make password nullable so users who only auth via Google don&#39;t need one.</p><blockquote><strong>Pitfall:</strong> Don’t try to store the provider token without encryption. Add it to $casts as encrypted and to $hidden.</blockquote><h3>6. Laravel Breeze — Still Works, But Officially in Maintenance</h3><p>Breeze was the friendly minimal scaffold: it published plain controllers into app/Http/Controllers/Auth and gave you Blade/Livewire/Inertia (Vue or React) flavors. Compared to Jetstream, <em>&quot;Breeze publishes controllers you edit directly. Jetstream hides auth logic behind Fortify.&quot;</em></p><p><strong>Status in 2026:</strong> Laravel 12 release notes explicitly state: <em>“With the introduction of our new application starter kits, Laravel Breeze and Laravel Jetstream will no longer receive additional updates.”</em> It still works in Laravel 12 and is patched for compatibility — Breeze is at v2.4.2 (released May 14, 2026, per Packagist) — but it’s not getting new features.</p><pre>composer require laravel/breeze --dev<br>php artisan breeze:install blade   # or vue, react, livewire, api<br>npm install &amp;&amp; npm run dev<br>php artisan migrate</pre><blockquote><strong>When to still use Breeze:</strong> Legacy projects on Laravel 11 or earlier. New tutorials and courses where “everything is a plain controller” makes pedagogy easier. If you want Blade with no JS toolchain and minimal opinion, Breeze (Blade stack) still wins on simplicity.</blockquote><h3>7. Laravel Jetstream — Deprecated, But Still Compatible with Laravel 12</h3><p>Jetstream went further than Breeze: 2FA, team management, browser session monitoring, profile photos, API token management UI. It used Fortify under the hood and shipped Livewire or Inertia-Vue stacks.</p><p><strong>Status in 2026:</strong> Same deprecation notice as Breeze — no new features. Jetstream is at v5.5.3 (released May 19, 2026, per Packagist), still compatible with Laravel 12, but the team management feature is being <em>replaced</em> in the new Laravel 13 Starter Kits. Povilas Korop summarized the Laracon EU 2026 announcement: <em>“The old starter kit Jetstream had a functionality of Teams, so the new starter kits will get it back, but implemented a bit differently.”</em></p><blockquote><strong>Senior-dev opinion:</strong> Don’t start a new project on Jetstream in 2026. If you need teams, wait for or use the Laravel 13 Teams implementation, or roll your own using Spatie Permission + a teams table. If you have a Jetstream project in production: it&#39;s fine. Don&#39;t rush to migrate.</blockquote><h3>8. Built-In Auth Scaffolding (Guards, Providers, Middleware, the Auth Facade)</h3><p>Underneath everything — Breeze, Jetstream, Fortify, Sanctum, Passport, Socialite — sits Laravel’s core authentication machinery: <strong>guards</strong> (how a user is authenticated for a request), <strong>providers</strong> (how to retrieve users), and <strong>middleware</strong> (auth, auth:sanctum, auth:api, verified, password.confirm).</p><p>For a tiny app, you can skip every package and write this yourself:</p><pre>// routes/web.php<br>Route::post(&#39;/login&#39;, function (Request $r) {<br>    $credentials = $r-&gt;validate([&#39;email&#39; =&gt; &#39;required|email&#39;, &#39;password&#39; =&gt; &#39;required&#39;]);<br>    if (Auth::attempt($credentials, $r-&gt;boolean(&#39;remember&#39;))) {<br>        $r-&gt;session()-&gt;regenerate();<br>        return redirect()-&gt;intended(&#39;/dashboard&#39;);<br>    }<br>    throw ValidationException::withMessages([&#39;email&#39; =&gt; &#39;Invalid credentials&#39;]);<br>});</pre><pre>Route::middleware(&#39;auth&#39;)-&gt;get(&#39;/dashboard&#39;, fn () =&gt; view(&#39;dashboard&#39;));</pre><p>That’s a complete login system in 10 lines. There’s no shame in this for admin tools, internal dashboards, or content-light sites.</p><h3>9. Laravel Passkeys — First-Party Passwordless Auth (New in 2026)</h3><p>This is the headline auth feature of 2026. Laravel released a first-party WebAuthn/passkeys package in late April 2026 — laravel/passkeys v0.1.0 was published on Packagist on April 22, 2026, and has since advanced to v0.2.1 (released May 18, 2026) — with a companion @laravel/passkeys npm client. In a May 12, 2026 Laravel News article titled &quot;Laravel Introduces First-Party Passkey Authentication Support,&quot; Eric L. Barnes wrote: <em>&quot;Laravel has introduced native passkey authentication support through new first-party packages… Laravel Fortify integrates the stack behind </em><em>Features::passkeys() and a passkeys section in config/fortify.php, so Fortify apps get the same endpoints and contracts (PasskeyUser, PasskeyAuthenticatable) without reimplementing glue.&quot;</em></p><p><strong>Setup:</strong></p><pre>composer require laravel/passkeys<br>php artisan vendor:publish --tag=passkeys-migrations<br>php artisan migrate</pre><pre>// app/Models/User.php<br>use Laravel\Passkeys\Contracts\PasskeyUser;<br>use Laravel\Passkeys\PasskeyAuthenticatable;</pre><pre>class User extends Authenticatable implements PasskeyUser<br>{<br>    use PasskeyAuthenticatable;<br>}</pre><pre>// Frontend (Vue example)<br>import { usePasskeyVerify, usePasskeyRegister } from &#39;@laravel/passkeys/vue&#39;;</pre><pre>const { verify } = usePasskeyVerify({ autofill: true,<br>    onSuccess: r =&gt; router.visit(r.redirect ?? &#39;/dashboard&#39;) });<br>const { register } = usePasskeyRegister();</pre><pre>&lt;input type=&quot;text&quot; autocomplete=&quot;email webauthn&quot; /&gt;<br>&lt;button @click=&quot;verify&quot;&gt;Sign in with passkey&lt;/button&gt;<br>&lt;button @click=&quot;register(&#39;My MacBook&#39;)&quot;&gt;Add a passkey&lt;/button&gt;</pre><p>The package fires events you can hook into, supports multiple passkeys per user, and integrates with Fortify’s password-confirm middleware. HTTPS is required — WebAuthn refuses to run on http://, including on 127.0.0.1 (use localhost or Valet&#39;s valet secure).</p><p><strong>Alternative:</strong> If your app is heavily Livewire-based and you already have spatie/laravel-passkeys working, you don&#39;t need to migrate — it ships ready-made Livewire components. But don&#39;t run both packages simultaneously; their routes overlap.</p><h3>10. Spatie laravel-permission — The De Facto Roles &amp; Permissions Package</h3><p>Authentication ≠ Authorization, and the moment you have more than one type of user, you need a role/permission system. The community-standard package is spatie/laravel-permission — at v7.4.1 (released April 29, 2026) with 96,199,540 Packagist installs and 12,873 GitHub stars (per Packagist, fetched May 21, 2026).</p><pre>composer require spatie/laravel-permission<br>php artisan vendor:publish --provider=&quot;Spatie\Permission\PermissionServiceProvider&quot;<br>php artisan migrate</pre><pre>// app/Models/User.php<br>use Spatie\Permission\Traits\HasRoles;<br>class User extends Authenticatable { use HasRoles; }</pre><pre>// Seeder<br>Permission::create([&#39;name&#39; =&gt; &#39;edit articles&#39;]);<br>Role::create([&#39;name&#39; =&gt; &#39;editor&#39;])-&gt;givePermissionTo(&#39;edit articles&#39;);</pre><pre>// Usage<br>$user-&gt;assignRole(&#39;editor&#39;);<br>$user-&gt;can(&#39;edit articles&#39;);     // true<br>@can(&#39;edit articles&#39;) ... @endcan<br>Route::get(&#39;/admin&#39;, ...)-&gt;middleware(&#39;role:admin&#39;);</pre><p>It plugs into Laravel’s Gate, supports multiple guards, teams (multi-tenancy), and integrates cleanly with Policies.</p><h3>11. Filament Authentication — For Admin Panels</h3><p>If you’re building an admin panel with Filament v4, authentication is built-in and now includes <strong>native multi-factor authentication</strong>: TOTP apps (Google Authenticator, 1Password) and email codes. Recovery codes are supported. You activate it in your panel provider:</p><pre>use Filament\Auth\MultiFactor\App\AppAuthentication;</pre><pre>public function panel(Panel $panel): Panel<br>{<br>    return $panel<br>        -&gt;profile()<br>        -&gt;multiFactorAuthentication([<br>            AppAuthentication::make()-&gt;recoverable(),<br>        ]);<br>}</pre><p>For passkeys + 2FA combined in a Filament panel, the popular community plugin is stephenjude/filament-two-factor-authentication, which adds a fluent API for enabling Google 2FA, passkey login, and forced setup.</p><h3>12. WebAuthn Community Packages (Pre-Native Passkeys Era)</h3><p>Before laravel/passkeys shipped, the community filled the gap with:</p><ul><li><strong>spatie/laravel-passkeys</strong> — Livewire-first, very ergonomic.</li><li><strong>laragear/webauthn</strong> — Lower-level, supports password fallback, EdDSA keys, blacklisting.</li><li><strong>livewirez/webauthn-laravel</strong> — Lightweight, no framework opinion.</li></ul><p>These are still maintained and valid, but for <strong>new projects</strong>, the first-party laravel/passkeys package is the right choice unless you have a specific reason to use a community option (e.g., heavy Livewire UI investment).</p><h2>Comparison Table: Which Laravel Auth Package for Which Use Case?</h2><h2>Decision Tree: “Which Laravel Auth Should I Pick for X?”</h2><ul><li><strong>Traditional Blade monolith / server-rendered app, single login form?</strong> → Laravel core auth + (optionally) the Livewire Starter Kit. Add Socialite if you need “Sign in with Google.”</li><li><strong>SaaS with Inertia (Vue/React/Svelte) SPA + Laravel API on the same domain?</strong> → New Starter Kit + Sanctum cookie mode (it’s already wired in). Add spatie/laravel-permission for roles.</li><li><strong>Mobile app + Laravel API?</strong> → Sanctum personal access tokens. If you also have a web SPA, you can run both modes simultaneously.</li><li><strong>Cross-domain frontend (Vercel/Netlify SPA → separate API host)?</strong> → Sanctum API tokens (not cookies — cookies require same top-level domain). Or proxy through your own domain.</li><li><strong>You want third-party developers to “Sign in with My App” — i.e., you ARE the identity provider?</strong> → Laravel Passport.</li><li><strong>Machine-to-machine API between your own microservices?</strong> → Passport Client Credentials grant, OR pre-shared Sanctum tokens for simpler cases.</li><li><strong>SaaS with teams (multi-tenancy)?</strong> → Laravel 13 Starter Kit (Teams returned) OR Spatie Permission’s team features OR stancl/tenancy. Avoid starting new Jetstream projects.</li><li><strong>Need social login (Google/GitHub/Apple/Facebook)?</strong> → Laravel Socialite. For Apple, LinkedIn-OIDC, or many others, also check socialiteproviders.com for community drivers.</li><li><strong>Need passkeys / passwordless?</strong> → laravel/passkeys + Fortify&#39;s Features::passkeys(). Heavy Livewire app? spatie/laravel-passkeys is still excellent.</li><li><strong>Need an admin panel with 2FA?</strong> → Filament v4 + native MFA. Or Filament + stephenjude/filament-two-factor-authentication plugin for passkeys too.</li><li><strong>Enterprise SSO (SAML, OIDC, SCIM)?</strong> → WorkOS-powered Starter Kit variant (free for up to 1M monthly active users, per Laravel 12 release notes). Or build it yourself on top of Passport’s OAuth2 + custom SAML adapter.</li></ul><h2>Security Best Practices (Briefly)</h2><ol><li><strong>Never store tokens in </strong><strong>localStorage</strong> for SPA auth. Use Sanctum&#39;s cookie mode or, if you must use tokens, store them in httpOnly cookies set server-side.</li><li><strong>Always rotate sessions on login</strong> ($request-&gt;session()-&gt;regenerate()).</li><li><strong>Hash passwords with bcrypt or argon2id.</strong> Laravel does this by default; don’t override it.</li><li><strong>Use HTTPS in production.</strong> Passkeys won’t work without it. Set SESSION_SECURE_COOKIE=true.</li><li><strong>Enable 2FA for privileged accounts.</strong> Fortify makes this a one-liner.</li><li><strong>Encrypt OAuth provider tokens</strong> at rest. Use &#39;encrypted&#39; casts on your provider_token column.</li><li><strong>Set sensible token expirations.</strong> For Sanctum: SANCTUM_TOKEN_EXPIRATION=43200 (30 days). For Passport access tokens: shorter (15 min) + refresh tokens.</li><li><strong>Rate-limit auth endpoints.</strong> Laravel’s throttle middleware is sufficient: Route::middleware([&#39;throttle:login&#39;])-&gt;post(&#39;/login&#39;, ...).</li><li><strong>Keep a password fallback when you adopt passkeys</strong> — not every user device supports them, and account recovery still needs a path.</li><li><strong>Audit logins.</strong> Listen to Illuminate\Auth\Events\Login, Failed, Logout events and log them.</li></ol><h2>Common Pitfalls (And How to Avoid Them)</h2><ul><li><strong>Sanctum SPA returning 419 / CSRF token mismatch?</strong> Your frontend isn’t calling GET /sanctum/csrf-cookie first, or your SESSION_DOMAIN is wrong, or supports_credentials isn&#39;t true in CORS.</li><li><strong>Sanctum SPA returning 401 with cookies set?</strong> Your SANCTUM_STATEFUL_DOMAINS doesn&#39;t match — only include hostname + port, no scheme, no trailing slash.</li><li><strong>Passport “personal access client not found”?</strong> Run php artisan passport:install (or passport:client --personal after a fresh migrate).</li><li><strong>Socialite always returning the same user?</strong> You’re not handling the provider_id carefully — match users on both email AND provider, or you&#39;ll merge accounts unexpectedly.</li><li><strong>Passkeys silently failing in dev?</strong> WebAuthn refuses non-HTTPS. Use valet secure, Herd&#39;s HTTPS toggle, or localhost exactly (not 127.0.0.1).</li><li><strong>Adopted Jetstream a year ago, now blocked on missing features?</strong> Don’t migrate; extend. The Fortify under-the-hood pattern lets you add nearly anything by overriding Actions.</li></ul><h2>FAQ: Laravel Authentication in 2026</h2><p><strong>Q: What is the best Laravel authentication package in 2026?</strong> A: For 90% of new projects: a new Starter Kit (React, Vue, Svelte, or Livewire) — they bundle Fortify, Sanctum, and now passkeys. For headless or mobile-first: Fortify directly. For OAuth2 server: Passport. Don’t start new projects on Breeze or Jetstream.</p><p><strong>Q: Is Laravel Breeze deprecated in 2026?</strong> A: Not “deprecated” in the strict sense, but the Laravel 12 release notes state: <em>“Laravel Breeze and Laravel Jetstream will no longer receive additional updates.”</em> They still work and receive compatibility patches (Breeze v2.4.2 was released May 14, 2026), but the new Starter Kits are the future.</p><p><strong>Q: Sanctum vs Passport — which should I use?</strong> A: Sanctum unless you need to be an OAuth2 provider. Passport is overkill for first-party SPAs and mobile apps and adds significant complexity (clients, keys, scopes, grants). Use Passport only when third parties need to log in via your app, or when you specifically need OAuth2’s Client Credentials grant for machine-to-machine auth.</p><p><strong>Q: How do I add authentication to a Laravel API for a mobile app?</strong> A: Use Sanctum’s personal access tokens. After login, return a token with $user-&gt;createToken(&#39;device-name&#39;)-&gt;plainTextToken, store it in the device&#39;s secure storage, and send it as Authorization: Bearer {token} on every request.</p><p><strong>Q: Does Laravel support passkeys / WebAuthn natively?</strong> A: Yes, as of April 2026. The first-party laravel/passkeys package (currently v0.2.1) plus Fortify&#39;s Features::passkeys() provides full WebAuthn support. New Laravel Starter Kits (v5.28.0+ installer) include it by default.</p><p><strong>Q: How do I add Google login to Laravel?</strong> A: Install Laravel Socialite (composer require laravel/socialite), add Google credentials to config/services.php, and create two routes — one for redirect, one for callback. See the code example above.</p><p><strong>Q: Do I need Laravel Fortify if I’m using a Starter Kit?</strong> A: No — the Starter Kits already use Fortify under the hood. You install Fortify <em>directly</em> only if you’re building a fully custom frontend (mobile, separate Nuxt/Next app, etc.) and want Laravel’s auth backend without any view scaffolding.</p><p><strong>Q: Can I use both Sanctum and Passport in the same app?</strong> A: Yes, by configuring separate guards. Common pattern: Sanctum for your own SPA + mobile, Passport for third-party developer APIs. It’s complex to maintain — only do this if you genuinely need both.</p><p><strong>Q: What’s the best Laravel authorization (roles &amp; permissions) package?</strong> A: spatie/laravel-permission — over 96 million Packagist installs as of May 2026, multi-guard support, team/multi-tenant support, integrates with Laravel Gate.</p><p><strong>Q: Should I use Jetstream’s team feature for SaaS in 2026?</strong> A: Not for new projects — Jetstream is in maintenance. Wait for or use the Laravel 13 Starter Kits’ Teams feature (announced at Laracon EU 2026), or roll your own teams table with Spatie Permission’s team support.</p><p><strong>Q: Is the WorkOS variant of the Starter Kits worth using?</strong> A: If you need enterprise SSO, SAML, SCIM, or want a hosted auth UI for free up to 1 million monthly active users — yes. If you want everything self-hosted with zero third-party dependencies — stick with the standard Starter Kit + Fortify + Socialite + passkeys.</p><p><strong>Q: How do I implement 2FA in Laravel?</strong> A: It’s built into Fortify. Enable Features::twoFactorAuthentication() in config/fortify.php, add the TwoFactorAuthenticatable trait to your User model, and the Starter Kits already render the QR code and recovery codes UI. For Filament admin panels, Filament v4 has native MFA.</p><h2>Recommendations</h2><p><strong>Starting a brand-new Laravel 12 or 13 project today?</strong></p><ol><li>laravel new and pick a Starter Kit matched to your team&#39;s frontend skill (Livewire for PHP teams, React/Vue/Svelte for JS teams).</li><li>Accept the default Fortify + Sanctum + (optionally) passkeys stack.</li><li>Add spatie/laravel-permission on day one — even if you &quot;only have admins and users today,&quot; you&#39;ll need it eventually.</li><li>Add Socialite the moment you need a “Sign in with Google” button — it’s a 30-minute install.</li><li>Don’t reach for Passport unless and until you have a specific OAuth2-server requirement.</li></ol><p><strong>Modernizing a Breeze/Jetstream app in 2026?</strong></p><ul><li>Don’t panic — both still work and are patched for Laravel 12 compatibility.</li><li>If you’re staying on Breeze/Jetstream: pin versions, lock Composer, and treat them as part of your application code.</li><li>If you’re migrating: pick a new Starter Kit that matches your existing frontend stack, scaffold a fresh project, and port your business logic over. Don’t try to “upgrade in place” — the structure is different enough that a fresh scaffold is faster.</li></ul><p><strong>Building a mobile-first API?</strong></p><ul><li>Fortify + Sanctum tokens. Skip the Starter Kits entirely; ship a Postman collection as your “frontend.”</li></ul><p><strong>Building an enterprise B2B SaaS?</strong></p><ul><li>Starter Kit (WorkOS variant) + Spatie Permission (team mode) + passkeys + enforced 2FA for admin roles.</li></ul><p><strong>Thresholds that should change your decision:</strong></p><ul><li>If your app needs to <strong>be</strong> an OAuth2 provider → switch to Passport.</li><li>If you have more than five distinct authentication flows (admin, customer, partner API, mobile app, public API, etc.) → consider a dedicated identity provider (WorkOS, Keycloak self-hosted, or roll your own with Passport).</li><li>If you serve regulated industries (healthcare, finance) → force 2FA, prefer passkeys, audit-log every auth event, and consider hardware security keys via WebAuthn attestation.</li></ul><h2>Caveats</h2><ul><li><strong>Laravel 13 was released on March 17, 2026</strong>, and the Teams + native passkeys features in the new Starter Kits are still maturing. The laravel/passkeys package is at v0.2.1 — its public API may still evolve before 1.0. For mission-critical production passkeys today, pin your version explicitly.</li><li><strong>Install counts and version numbers</strong> in this article were captured from Packagist on May 21, 2026 and are point-in-time snapshots.</li><li><strong>Some sources cited in this article</strong> are vendor blogs and individual developer write-ups; where possible I’ve cross-referenced against official Laravel documentation and Laravel News (Eric L. Barnes’s reporting in particular).</li><li><strong>The Laravel ecosystem moves fast.</strong> Even within 2026, expect Starter Kit features (especially Teams, which is brand new) to evolve. Always check the official docs for breaking changes before upgrading.</li><li><strong>No silver bullets.</strong> “Auth0/Clerk/WorkOS vs first-party Laravel” is a real trade-off I deliberately skipped here — this article focuses on Laravel-native options. Managed services can save engineering time but introduce vendor lock-in and recurring cost. Pick the trade-off that matches your team and product.</li></ul><p><em>If this guide saved you from a </em><em>419 PAGE EXPIRED headache or a needless Passport install, give it a clap and share it with the Laravel dev who keeps asking &quot;Sanctum or Passport?&quot; in your team Slack. Happy authenticating.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4c68039bf2e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>