We earn commissions when you shop through the links below.
I’ve been writing PHP for over a decade. I’ve tried every IDE extension, every Copilot alternative, every AI pair-programming tool that promised to make me faster. Most of them are fine. A few are genuinely good. And then there’s Cursor — which I think is in a category of its own, especially if you’re a PHP developer spending most of your day inside Laravel or Symfony codebases.
This isn’t a sponsored fluff piece. I’m going to walk through what Cursor actually does well for PHP work, where it falls short, and whether you should pay for it.
What Is Cursor, Exactly?
Cursor is a fork of VS Code built around AI-first editing. It’s not a plugin — it’s a full editor. You get everything you know from VS Code (extensions, keybindings, themes, settings sync) plus a deeply integrated AI layer that goes far beyond autocomplete.
The key features that matter for day-to-day PHP development are:
- Tab completion — multi-line, context-aware suggestions that understand what you were about to write
- Cmd+K (inline editing) — highlight code, describe what you want, it rewrites in place
- Chat with codebase context — ask questions about your own project, not just generic code
- Composer (agent mode) — give it a task, it writes files, edits multiple locations, runs terminal commands
The underlying models are Claude 3.5 Sonnet, GPT-4o, and Cursor’s own fine-tuned models. You can switch between them depending on the task.
First Impressions: PHP Autocomplete Is Actually Good
My biggest complaint with GitHub Copilot in PHP projects was that suggestions felt generic. It knew PHP syntax but not my project’s conventions. Cursor’s tab completion feels different because it reads your open files and recent edits to build context.
Here’s a concrete example. I was building a repository pattern in Laravel. I had an interface already written and one concrete implementation. When I started a second implementation for a different data source, Cursor suggested the entire class structure — matching my existing naming conventions, injecting the same dependencies, and using the same method signatures from the interface — without me asking.
<?php
namespace App\Repositories;
use App\Contracts\OrderRepositoryInterface;
use App\Models\Order;
use Illuminate\Support\Collection;
class CachedOrderRepository implements OrderRepositoryInterface
{
public function __construct(
private OrderRepositoryInterface $inner,
private \Illuminate\Cache\Repository $cache,
private int $ttl = 3600
) {}
public function findById(int $id): ?Order
{
return $this->cache->remember(
"order:{$id}",
$this->ttl,
fn () => $this->inner->findById($id)
);
}
public function findByUser(int $userId): Collection
{
return $this->cache->remember(
"orders:user:{$userId}",
$this->ttl,
fn () => $this->inner->findByUser($userId)
);
}
public function save(Order $order): bool
{
$this->cache->forget("order:{$order->id}");
$this->cache->forget("orders:user:{$order->user_id}");
return $this->inner->save($order);
}
}
That’s almost exactly what Cursor suggested when I typed the class declaration. It inferred the decorator pattern from my existing code. That kind of context-awareness is where it earns its keep.
Cmd+K for Refactoring PHP: Where It Shines
The inline edit shortcut (Cmd+K on Mac, Ctrl+K on Windows) is the feature I use most. You highlight a block of code, type a plain English instruction, and it rewrites the selection in place. You can accept or reject the diff.
Real use cases I’ve run through this week alone:
- “Convert this array-based config to a typed DTO class”
- “Add PHPDoc blocks to all public methods”
- “Rewrite this query builder chain using Eloquent scopes”
- “Extract this validation logic into a FormRequest class”
The results are consistently good. Not perfect — I always review the diff — but good enough that they save significant time. Extracting a FormRequest used to take me five minutes of copy-pasting and renaming. Cursor does it in about 15 seconds.
Where Cmd+K gets tricky is with complex business logic. If you have a method that’s 80 lines of dense conditional logic, Cursor’s rewrites can introduce subtle bugs. I’ve learned to break these into smaller selections rather than asking it to refactor the whole thing at once.
Codebase Chat: Genuinely Useful for Large Projects
Cursor indexes your entire codebase and lets you ask questions about it. This is more useful than it sounds. Some real questions I’ve asked in a 150k-line Laravel project:
- “Where do we handle subscription cancellation?” — it found the relevant service class, the event listener, and the webhook handler
- “What middleware is applied to the API routes?” — gave me an accurate summary instead of me grepping through route files
- “Show me all places where we query the orders table without using the repository” — found three offenders I hadn’t noticed
This is the feature that justifies the subscription for me on large codebases. On a solo project with 5k lines it’s less impressive. On a team project you’ve inherited or a codebase you’ve partially forgotten, it’s like having a colleague who actually read all the code.
Composer (Agent Mode): Powerful but Needs Supervision
Cursor’s Composer feature lets you describe a multi-step task and watch it execute across multiple files. I tested this by asking it to “add a feature flag system to this Laravel app with a database-backed store, an Artisan command to toggle flags, and Blade directive support.”
It created a migration, a model, a service class, an Artisan command, a service provider, and registered the Blade directive. The code was 80% correct on the first pass. I needed to fix the service provider registration and adjust one method signature, but the scaffolding was solid.
The important caveat: Composer can and does make mistakes. It occasionally edits the wrong file or makes an assumption that breaks something. I always run tests immediately after a Composer session. If you don’t have tests, this feature is higher risk — it moves fast and touches a lot of files.
PHP-Specific Limitations to Know About
Cursor isn’t perfect for PHP. Here’s what I’ve run into:
PHPStan and Psalm integration is still on you. Cursor doesn’t automatically run static analysis. It’ll generate code that looks correct but has type errors that PHPStan would catch. You still need your normal toolchain. I run PHPStan as part of my pre-commit hooks and that hasn’t changed.
It doesn’t always know recent Laravel versions. If you’re on Laravel 11 with the new slim application structure, Cursor sometimes suggests patterns from Laravel 8 or 9. You can correct this by telling it your framework version in the system prompt (Cursor lets you set a project-level custom prompt in settings).
Blade templates are hit or miss. The AI handles plain PHP exceptionally well. Complex Blade templates with lots of component nesting and Livewire integration get messier. It’s fine for simple templates, but I wouldn’t trust it to write complex Livewire component logic without careful review.
Database schema awareness requires work. Unless you explicitly include your migration files in the context or describe your schema, Cursor doesn’t know your table structure. I’ve started keeping a schema summary file in my project root that I @mention in chat when working on database-adjacent code.
Pricing: Is the Pro Plan Worth It?
Cursor has a free tier with limited completions and a Pro plan at $20/month. For professional PHP development, the free tier is not enough — you’ll hit limits within a few hours of real work.
The Pro plan is worth it if you’re billing clients or working at a company. At $20/month it pays for itself the first time it saves you from writing a full service class from scratch or debugging a stupid typo for 20 minutes. For freelancers and indie developers, it’s a straightforward productivity investment.
I’d suggest pairing Cursor with solid hosting so your deployments match the quality of your development. I host most of my PHP projects on Hostinger for smaller sites and DigitalOcean for anything that needs more control — both work well with Laravel and give you clean server environments that don’t fight you.
Setting Up Cursor for PHP Development
If you decide to try it, here’s how I configure Cursor for PHP work:
- Install the PHP Intelephense extension (same as in VS Code)
- Set your PHP executable path in settings
- Add a
.cursorrulesfile in your project root describing your framework version, coding standards, and any conventions the AI should follow - Add your schema or data model docs to the project so you can @mention them in chat
- Set the default model to Claude 3.5 Sonnet for PHP work — in my experience it handles PHP idioms better than GPT-4o
The .cursorrules file is underrated. Something as simple as “This is a Laravel 11 project using PHPStan level 8. Use constructor property promotion. Prefer readonly properties where appropriate. Always type-hint return values.” makes a significant difference in output quality.
Verdict
Cursor is the best AI coding tool I’ve used for PHP development. The tab completion is smarter than Copilot, the inline editing is faster than any alternative, and the codebase chat feature solves a real problem on large projects. The agent mode is powerful but requires the kind of oversight you’d give a junior developer — useful, not autonomous.
The limitations are real: you still need PHPStan, it doesn’t always know the latest Laravel conventions, and Blade support is imperfect. But none of those are dealbreakers. They’re just things to be aware of.
If you’re a PHP developer spending 40+ hours a week in an editor, the $20/month for Cursor Pro is one of the easier productivity investments you can make. Try the free tier for a week on a real project and you’ll know within two days whether it’s worth it for your workflow.