I like working with Laravel because I usually know where to look.

If I'm checking whether someone can update a record, I'll look for a policy. If I'm investigating request validation, there's a reasonable chance it lives in a form request. Background work probably has a job class. There's a shared vocabulary, and once you know it, you can get around a project fairly quickly.

Working with AI has made me appreciate that a lot more.

An AI assistant can produce a substantial amount of code before you've finished your coffee. You then have to read and understand it, and decide if you want to maintain it - and I think that part deserves a lot more attention than it sometimes gets.

I'm always wary of unnecessary architecture. Give an assistant a fairly ordinary feature and, depending on the instructions, it can come back with a service, a repository, a contract and a manager to coordinate the entire arrangement.

Sometimes those things earn their place. Sometimes they're superfluous extra steps that route to the same Eloquent query.

If CustomerRepository::find() just calls Customer::find(), then I'd like a good reason for the extra step.

The cost of creating another class has become very small. The cost of understanding how an application fits together is still there. Every new abstraction is another decision someone will eventually have to work through, often while trying to fix something else.

This is where I think Laravel has a real advantage when working with AI.

The framework already gives us plenty to work with. Form requests, policies, job, events, notifications, and the service container all have established purposes. An assistant can inspect how a project uses them and work within that structure.

That also makes the result easier for me to review. I have somewhere sensible to start. I can follow a request through the application and concentrate on the decisions the feature actually needs to make.

Of course, "follow Laravel conventions" still leaves room for interpretation.

Laravel gives you several perfectly reasonable ways to solve a problem. Existing projects have their own habits too. If an application consistently uses action classes for business operations, I expect a new feature to also follow that pattern. If a straightforward operation lives comfortably in a controller, introducing a separate architecture for the next endpoint needs some justification.

I want the assistant to read the surrounding code before deciding what a feature or application ought to look like.

That sounds obvious, but it's worth making explicit. A solution can look perfectly respectable in isolation and still be an awkward fit for the project it's being added to.

"Write clean code" is too vague to be particularly useful. Describe what matters, explain how the tests are organised, which components already exist, how shared behaviour is handled and which parts of the application a change needs to preserve.

On this website for example, Contentful content is imported into local records by scheduled commands. The pages read those records. That arrangement matters when changing the interface. An assistant needs to understand it before deciding to fetch content from somewhere else because that happens to suit the code it's generating.

Laravel Boost helps here. It gives agents access to framework guidelines, application information, and relevant documentation. I like having the installed packages and their documentation available during the work. They provide a firmer starting point rather than relying on whatever version or approach an assistant happens to recall.

While working on this site, an AI assisted metadata test passed locally and failed in GitHub Actions. It expected the page title to end with myke.codes. That was my local application name, CI was using Laravel's default.

The application was doing exactly what it should; read its configuration. The test had assumed a value it never set.

The fixture was corrected by explicitly configuring the application name inside the test. It was a small change, but a useful reminder. A passing test can carry the same assumption as the implementation it's supposed to be checking.

Generated tests deserve a proper read. I want to know whether they describe the requirement, whether the fixtures resemble the data we actually receive, and whether the failure cases tell us anything useful. A green test is only reassuring once I understand what went green.

None of this stops me using AI. It does affect how I use it, however.

I'll ask it to investigate an existing implementation before changing it. I'll give it specific behaviour to test. I'll keep the changes small enough to follow through the diff. When it introduces another layer, I'll ask what that layer buys, and weigh that cost myself.

I'm very comfortable being fairly demanding about that. It's going into an application I'm responsible for. Laravel's conventions make those conversations easier. They give us an existing structure to examine and a shared set of names for the work. The interesting decisions can then get the attention they deserve: who should be allowed to do something, what should happen when an integration fails, and how the application should recover.

A year from now, I want to open that code and recognise the application I was building. Familiar structure, clear decisions, useful tests. I want those things to survive every feature added, however the code gets written.