Tag: PHP

Building an MCP Server with Laravel

Mar 26, 2026 #Laravel #PHP #AI

If you've used Claude Code, Cursor, or any AI coding assistant recently, you've probably noticed they're getting better at doing things, not just generating text. The bridge that makes this possible is MCP: the Model Context Protocol. I've built two MCP servers that I use daily. One manages the blog you're reading right now. The other is a personal knowledge base called Acervo. Both are Laravel apps, and both let me manage content directly from Claude Code without ever opening a browser.

Read more

Setting Up Laravel Boost with Claude Code

Mar 26, 2026 #Laravel #PHP #AI

Claude Code is already fast. Point it at a Laravel project and it can read files, run tests, execute commands. But it's working blind. It doesn't know your routes, your database schema, or what's in your logs until it goes digging through files. That's where Laravel Boost comes in. Boost exposes your Laravel application's internals as MCP tools. Routes, models, schema, logs, tinker, all available to Claude Code without it having to parse files or guess. The difference is immediate: instead of Claude Code grep-ing through your route files, it just knows your routes. If you haven't read it yet, my post on What is Laravel Boost and Why Every Laravel Dev Needs It covers what Boost does and why it matters. This post focuses on the hands-on setup with Claude Code.

Read more

How Laravel Boost Makes AI Understand Your Codebase

Mar 25, 2026 #Laravel #PHP #AI

Every Laravel app has opinions. Naming conventions, custom casts, query scopes, validation patterns, how you structure form requests. All of it adds up to a codebase that works a certain way. Ask an AI to generate code for your app without that context and you get textbook Laravel that compiles but doesn't belong. The generated controller uses $request->all() instead of your form request classes. The migration uses string where you always use an enum cast. The query builds raw joins instead of using your custom scopes. It's technically correct and practically useless.

Read more

Laravel 13: Laravel's AI Era

Mar 19, 2026 #Laravel #PHP #AI

Laravel 13 dropped on March 17, 2026. If you read my What's New in Laravel 13 post, you already know the full changelog. This post isn't about that. This post is about the signal Laravel 13 sends: Laravel is now an AI-first framework, and it's not even subtle about it.

Read more

What's New in Laravel 13

Mar 18, 2026 #Laravel #PHP

Laravel 13 dropped with zero breaking changes and a heavy focus on AI tooling. The upgrade from 12 is smooth, but the new features are worth paying attention to, especially if you're building anything that touches AI, APIs, or search.

Read more

The Null Object Pattern: Simplify Your PHP Code

Jan 11, 2025 #PHP

Handling null values in PHP can be a pain. We've all seen (or written) code that’s riddled with if checks just to deal with null. But what if I told you there’s a cleaner way? Enter the Null Object Pattern, a simple yet effective solution for avoiding unnecessary checks while keeping your code easy to read and maintain. Let me show you how it works.

Read more

PHP Annotations: Streamlining Your Code with Attributes

Jan 9, 2025 #PHP

Let’s rewind to 2020. PHP 8.0 lands, and developers get their hands on something they’d been craving for years: attributes. Think of them as PHP’s version of annotations—a way to embed metadata directly into your code. No more juggling bulky docblocks or fragile YAML files. Now you can keep things simple and readable.

Read more

When to Use Traits in PHP

Jun 4, 2024 #PHP #Traits

Traits are a powerful feature in PHP, introduced in PHP 5.4, that allows developers to reuse code across different classes independently of class hierarchies. They serve as a mechanism for horizontal code reuse, helping to avoid issues related to multiple inheritance and allowing for a more modular and maintainable codebase. This blog article will explore the ideal scenarios for using traits, provide examples, and offer best practices, including how to organize traits within a project.

Read more

Exposing Your Laravel App to AI Agents via MCP

#Laravel #PHP #AI

The Model Context Protocol (MCP) gives AI agents a structured way to call tools, read resources, and take actions in external systems. If you have a Laravel app, you can build an MCP server that lets agents interact with your application (creating content, querying data, triggering workflows) through a well-defined interface you control. This isn't theoretical. I've built MCP servers for production Laravel apps. Here's what I've learned.

Read more

Building AI Agents with Laravel AI SDK

#Laravel #PHP #AI

Laravel AI SDK (formerly Prism) ships with a first-class agent abstraction. An agent is an LLM-powered loop: it receives a prompt, decides which tools to call, processes the results, and repeats until it has a final answer. Unlike a single generate() call, agents maintain context across multiple steps and can take actions autonomously. Here's what that looks like in practice.

Read more

Getting Started with Laravel AI SDK

#Laravel #PHP #AI

Laravel shipped its first-party AI SDK in February 2026. After months of community packages filling the gap, laravel/ai landed as the official way to work with LLMs, speech synthesis, and structured outputs, all with the ergonomics you'd expect from a Laravel package. It matured alongside Laravel 13 and is now stable. Here's what you need to know to start using it.

Read more
Copyright 2026. All rights reserved
  • Codepen Logo
  • Youtube Logo
  • GitHub Logo
  • Twitter Logo
  • LinkedIn Logo