<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/make-ai-generated-laravel-code-much-better-don-t-trust-agents--9ma9msbng" -->

---
title: Make AI-Generated Laravel Code MUCH Better (Don't Trust...
description: Using cheaper AI models like DeepSeek to generate Laravel and Filament code often produces broken results because models skip verification steps. The key...
canonical: https://daily.dev/posts/make-ai-generated-laravel-code-much-better-don-t-trust-agents--9ma9msbng
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Make AI-Generated Laravel Code MUCH Better (Don't Trust Agents) | daily.dev
og:description: Using cheaper AI models like DeepSeek to generate Laravel and Filament code often produces broken results because models skip verification steps. The key...
og:url: https://daily.dev/posts/make-ai-generated-laravel-code-much-better-don-t-trust-agents--9ma9msbng
og:image: https://api.daily.dev/og/posts/9Ma9msBnG.png
og:image:alt: Make AI-Generated Laravel Code MUCH Better (Don't Trust Agents)
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Make AI-Generated Laravel Code MUCH Better (Don't Trust Agents)

**[Laravel Daily](https://daily.dev/sources/laraveldaily)** · 10 min read · 13 upvotes · 0 comments

## Summary

Using cheaper AI models like DeepSeek to generate Laravel and Filament code often produces broken results because models skip verification steps. The key insight is to add deterministic verification tools — specifically Larastan for static analysis and smoke tests — to the agent's workflow rather than relying on more detailed prompt instructions. When the DeepSeek Flash model was instructed to run Larastan, it found 24 errors (including wrong Filament namespaces) and fixed them in under 2 minutes for 1 cent. Smoke tests further validated that pages and endpoints actually work. The broader lesson: AI is non-deterministic by nature, so pairing it with deterministic tools like static analyzers and automated tests gives even cheap models the feedback loop needed to produce correct code.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=DlFCOelXuFM>

## Questions this post answers

### How can I make a cheap AI model like DeepSeek generate reliable Laravel and Filament code?

Pair the model with deterministic verification tools rather than relying on instructions in CLAUDE.md or AGENTS.md files, since those are only advisory and models skim them probabilistically. Running Larastan static analysis and Filament smoke tests that hit admin panel URLs exposes real errors, such as a Filament namespace change breaking a table action class, which the model can then fix when given the actual error output.

_daily.dev surfaces practical workflows like this for developers hardening AI-assisted Laravel projects._

### Why did Laravel Shift produce different upgrade results than an AI agent upgrading Laravel 9 to Laravel 13?

Laravel Shift uses deterministic scripts, built on PHP Rector and decisions from the Laravel core team and its creator Jason's years of experience, so it consistently produces a fully upgraded app with Laravel 13 syntax. An AI agent upgrading the same codebase is non-deterministic and may choose to just make tests pass without fully adopting the new syntax, giving different results on repeated runs.

_developers deciding between AI-driven and scripted framework upgrades can track these tradeoffs on daily.dev._

### What does Larastan level 7 catch that AI-generated Laravel tests might miss?

Larastan static analysis caught 24 errors in an AI-generated Laravel and Filament project, including a Filament Tables Action class not found error caused by a namespace change in newer Filament versions. The passing feature tests generated by the AI model did not catch this because the tests themselves were flawed, while static analysis flagged the broken code directly.

_daily.dev helps developers verifying AI-written Laravel code keep up with tools like Larastan._

## Similar posts on daily.dev

- [Evals in Laravel: How to Prove Your AI Output Is Actually Good](https://daily.dev/posts/evals-in-laravel-how-to-prove-your-ai-output-is-actually-good-v8xwwmodq) · FREEK.DEV · 1 upvotes · 0 comments
- [You added AI to your app. Can you see what it’s doing?](https://daily.dev/posts/you-added-ai-to-your-app-can-you-see-what-it-s-doing--6egxgutjz) · Medium · 1 upvotes · 0 comments
- [Extracting AI rules from an existing codebase](https://daily.dev/posts/extracting-ai-rules-from-an-existing-codebase-hb4diek2w) · Laravel · 1 upvotes · 0 comments

---

Tags: [#laravel](https://daily.dev/tags/laravel), [#ai-coding](https://daily.dev/tags/ai-coding)

[View this post on daily.dev](https://daily.dev/posts/make-ai-generated-laravel-code-much-better-don-t-trust-agents--9ma9msbng)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Make AI-Generated Laravel Code MUCH Better (Don't Trust Agents)","url":"https://daily.dev/posts/make-ai-generated-laravel-code-much-better-don-t-trust-agents--9ma9msbng","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/make-ai-generated-laravel-code-much-better-don-t-trust-agents--9ma9msbng"},"datePublished":"2026-07-18T08:30:55.139Z","dateModified":"2026-09-13T18:51:40.044Z","description":"Using cheaper AI models like DeepSeek to generate Laravel and Filament code often produces broken results because models skip verification steps. The key...","image":"https://i.ytimg.com/vi/DlFCOelXuFM/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/DlFCOelXuFM/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Laravel Daily","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Laravel Daily","logo":"https://media.daily.dev/image/upload/s--vzdgNGfl--/f_auto/v1725044498/logos/laraveldaily","url":"https://daily.dev/sources/laraveldaily"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/make-ai-generated-laravel-code-much-better-don-t-trust-agents--9ma9msbng","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":13},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"laravel,ai-coding","timeRequired":"PT10M","video":{"@type":"VideoObject","name":"Make AI-Generated Laravel Code MUCH Better (Don't Trust Agents)","description":"Using cheaper AI models like DeepSeek to generate Laravel and Filament code often produces broken results because models skip verification steps. The key...","thumbnailUrl":"https://i.ytimg.com/vi/DlFCOelXuFM/sddefault.jpg","uploadDate":"2026-07-18T08:30:55.139Z","duration":"PT10M","url":"https://api.daily.dev/r/9Ma9msBnG","embedUrl":"https://www.youtube.com/embed/DlFCOelXuFM"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Laravel Daily","item":"https://daily.dev/sources/laraveldaily"},{"@type":"ListItem","position":3,"name":"Make AI-Generated Laravel Code MUCH Better (Don't Trust Agents)"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/make-ai-generated-laravel-code-much-better-don-t-trust-agents--9ma9msbng#faq","mainEntity":[{"@type":"Question","name":"How can I make a cheap AI model like DeepSeek generate reliable Laravel and Filament code?","acceptedAnswer":{"@type":"Answer","text":"Pair the model with deterministic verification tools rather than relying on instructions in CLAUDE.md or AGENTS.md files, since those are only advisory and models skim them probabilistically. Running Larastan static analysis and Filament smoke tests that hit admin panel URLs exposes real errors, such as a Filament namespace change breaking a table action class, which the model can then fix when given the actual error output. daily.dev surfaces practical workflows like this for developers hardening AI-assisted Laravel projects."}},{"@type":"Question","name":"Why did Laravel Shift produce different upgrade results than an AI agent upgrading Laravel 9 to Laravel 13?","acceptedAnswer":{"@type":"Answer","text":"Laravel Shift uses deterministic scripts, built on PHP Rector and decisions from the Laravel core team and its creator Jason's years of experience, so it consistently produces a fully upgraded app with Laravel 13 syntax. An AI agent upgrading the same codebase is non-deterministic and may choose to just make tests pass without fully adopting the new syntax, giving different results on repeated runs. developers deciding between AI-driven and scripted framework upgrades can track these tradeoffs on daily.dev."}},{"@type":"Question","name":"What does Larastan level 7 catch that AI-generated Laravel tests might miss?","acceptedAnswer":{"@type":"Answer","text":"Larastan static analysis caught 24 errors in an AI-generated Laravel and Filament project, including a Filament Tables Action class not found error caused by a namespace change in newer Filament versions. The passing feature tests generated by the AI model did not catch this because the tests themselves were flawed, while static analysis flagged the broken code directly. daily.dev helps developers verifying AI-written Laravel code keep up with tools like Larastan."}}]}
```

