We have a confession. A significant portion of our enterprise AI integration work runs on PHP. Specifically Laravel. This is apparently embarrassing in 2025, when the correct answer to every architecture question is supposed to be Python or TypeScript. But here is the thing: it works, and "it works" is the only metric that matters in production.
The Status Quo Bias in Reverse
The tech industry has a peculiar bias: it assumes newer is better. Python is better than PHP. Rust is better than Go. Whatever launched this quarter is better than whatever launched five years ago. Sometimes this is true. Often it is not.
Hassan and I have a combined twenty-plus years of enterprise delivery. We have built systems in PHP, Python, Java, TypeScript, Go, and probably a few others we have mercifully forgotten. The consistent lesson: the language matters far less than the architecture, the team's expertise, and the operational maturity of the ecosystem.
I have seen PHP codebases that are beautifully architected and Python codebases that are unmaintainable nightmares. The engineer is the craftsperson.
Hassan Nawaz
Senior Developer
Why Laravel Works for Enterprise AI
The AI part of an enterprise AI system is often a surprisingly small percentage of the total codebase. The model call is a few lines. The retrieval pipeline is a module. The prompt management is a service. The vast majority of the system is everything else: authentication, authorisation, data management, queue processing, scheduling, caching, API routing, webhooks, and the hundred other concerns that enterprise applications need.
Laravel excels at these concerns. It has done so for over a decade. Its queue system is robust. Its authentication is battle-tested. Its ORM handles complex data relationships. Its ecosystem includes packages for almost every enterprise integration you can imagine.
Here is the practical argument:
Your existing systems are probably PHP. A significant portion of NZ enterprise applications run on PHP. WordPress, Laravel, custom PHP applications. When the AI system needs to integrate with existing infrastructure, using the same stack eliminates an entire class of integration complexity.
Your existing team probably knows PHP. Retraining a team on a new language and framework to build AI capabilities is a six-to-twelve-month investment. Building AI capabilities in a language your team already knows takes weeks.
Laravel's queue system is ideal for AI workloads. AI inference is inherently asynchronous. You send a request, wait for the model, process the response. Laravel's queue system handles this natively with retry logic, failure handling, rate limiting, and monitoring. We did not need to build any of that.
The HTTP client is more than adequate. Calling an AI model API is an HTTP request. Laravel's HTTP client, built on Guzzle, handles this with retries, timeouts, and middleware. The fact that we are calling OpenAI or Anthropic instead of a traditional API changes nothing about the transport layer.
What We Actually Build
A typical enterprise AI integration in our Laravel stack:
Service layer. An AI service class that handles model communication, prompt management, and response parsing. This is maybe 200 lines of code. It is the simplest part of the system.
Pipeline layer. A retrieval pipeline that fetches relevant context from databases, document stores, and external APIs. This uses Laravel's existing database and HTTP tooling. No special AI framework needed.
Queue layer. Async AI processing for non-real-time tasks. Document analysis, report generation, batch processing. Laravel's queues handle the orchestration, retries, and failure management.
API layer. Endpoints that expose AI capabilities to frontend applications and other systems. Standard Laravel API routes with standard authentication and authorisation.
Integration layer. Connections to existing enterprise systems. CRM, ERP, document management, email. This is where Laravel's ecosystem shines. Most of these integrations already exist as packages.
The AI-specific code is perhaps 10-15% of the total system. The rest is standard enterprise application development, and that is precisely where Laravel's maturity is an advantage.
The Honest Tradeoffs
We are not claiming PHP is the best language for everything. There are legitimate cases where other stacks make more sense:
ML training and fine-tuning. If you are training models, Python's ecosystem is unmatched. PyTorch, TensorFlow, Hugging Face. This is Python's domain and it should stay that way.
Heavy data processing. If your AI pipeline involves significant data transformation, Python's data science ecosystem (pandas, numpy, scikit-learn) is superior.
Real-time streaming. If you need streaming AI responses with WebSocket connections, Node.js or Go may be simpler than PHP's process model.
Team preference. If your team does not know PHP and does know Python, use Python. Team expertise always trumps language suitability.
But for the common case, an enterprise that needs AI capabilities integrated into existing systems, serving existing users, connecting to existing data, Laravel is not a compromise. It is a pragmatic choice.
The Broader Point
The AI industry has a technology snobbery problem. The implicit message is that serious AI work requires Python, preferably with a complex ML pipeline, custom model training, and a GPU cluster. This is true for a tiny fraction of enterprise AI work. Most enterprise AI is integration work: connecting models to data, systems, and people.
Integration work does not need the latest framework. It needs reliability, maintainability, and a team that knows what they are doing. If your team builds reliable enterprise software in Laravel, they can build reliable enterprise AI in Laravel.
Nobody has ever asked us what language our AI integration layer is written in. The answer to all three is yes.
John Li
Chief Technology Officer
The language does not matter. The architecture matters. The operational maturity matters. The team's expertise matters. Everything else is fashion.

