Skip to content

The Deska blog

Running Agents on a Laravel App

A technical guide on running agents on a Laravel app using specialized developer workspaces and local-first AI coding tools for efficient backend workflows.

10 min read

Modern backend development requires more than just a text editor and a terminal. As the complexity of frameworks like Laravel grows, the cognitive load of managing migrations, service providers, and complex business logic increases. Integrating AI into this cycle is the next logical step. By running agents on a Laravel app, developers can automate repetitive scaffolding tasks and debug deep architectural issues without leaving their specialized environment.

The Architecture of AI Agents in Laravel

Laravel is a highly structured framework. It relies on specific conventions for directory mapping, naming classes, and defining relationships. When you use a generic LLM, you often spend time copy pasting code and explaining your directory structure. An agent, however, is an autonomous entity that can read your file system, execute shell commands, and verify its own output.

These agents typically interact with the Laravel ecosystem through the command line. They can run php artisan commands to generate code or vendor/bin/phpunit to validate logic. The efficiency of this process depends on how much context the agent has. If the agent can see your logs, your database schema, and your routes simultaneously, the quality of its suggestions improves significantly.

Comparing Agentic Approaches for PHP Developers

There are several ways to implement AI agents in your daily workflow. Each approach has trade offs regarding privacy, speed, and integration depth.

ApproachContext AwarenessPrivacy LevelTool Integration
Browser ChatLow (Manual Upload)VariableNone
IDE ExtensionsMedium (Open Files)Cloud BasedIntegrated Terminal
Standalone AgentsHigh (Full Filesystem)Local FirstDirect Shell Access

Tools like Claude Code or Codex CLI differ in approach compared to standard extensions. They operate as processes within your environment, meaning they can navigate the entire Laravel project root. This is crucial for tasks like refactoring a service that spans across multiple controllers and blade templates.

Orchestrating Agents within Deska

Deska provides a specialized environment for running these agents side by side with your active code. Instead of flipping between windows, you utilize an infinite canvas where different panels handle different parts of the Laravel lifecycle. You can place a terminal running a watcher next to an AI agent panel and a browser preview of your application.

The canvas allows you to zoom out and see the entire operation at once. When you are running agents on a Laravel app within Deska, you can invoke Claude Code, Codex CLI, or OpenCode as individual panels. This local first approach ensures that your proprietary business logic and environment variables never leave your machine unnecessarily.

Using the Ask Deska assistant, you can even direct the workspace through voice or chat. For example, you can ask the assistant to open a terminal and run your migrations while the agent is busy writing the corresponding feature tests. This orchestration reduces context switching, which is the primary killer of developer productivity.

Setting Up a Specialized Laravel Workspace

To get the most out of AI agents, your workspace should be organized logically. A typical Laravel setup in a spatial environment includes the following elements:

  • A code editor panel focused on the app/ directory for core logic.
  • Multiple terminals for Artisan commands and running the agent CLI.
  • A browser panel pointed at the local development URL to verify UI changes.
  • A notes panel to track prompts or long term architectural goals.

Because Deska is local-first, the speed of these interactions is limited only by your hardware and API latency. You are not waiting for a remote container to spin up or sync files. The agent reads the files directly from your disk, allowing for near instantaneous feedback loops.

Managing Agents on the Move

Laravel developers often need to monitor long running tasks, such as large data migrations or complex refactors performed by an agent. Using the mobile app, you can pair your phone directly to your desktop instance. This secure relay does not expose your local ports to the public internet. It allows you to check the terminal output of an agent or respond to a prompt while you are away from your desk.

This connectivity is particularly useful when an agent requires manual intervention or hits a rate limit. You can see the status of your coding agents and ensure the build is still passing without needing to be physically present at your workstation.

Frequently Asked Questions

How do I run Claude Code on Laravel?

You can run Claude Code by opening a terminal panel in your project root and executing the Claude CLI command. In a spatial workspace, you can keep this agent panel open alongside your routes and controller files to give the agent full visibility of the changes it needs to make.

Can AI agents run php artisan commands?

Yes, agents with shell access can execute any Artisan command. This includes creating models, running migrations, and clearing caches. It is important to monitor the agent output to ensure that destructive commands, like migrating fresh, are only executed when intended.

Is my Laravel code safe with AI agents?

Security depends on the agent and the workspace you choose. By using a local-first tool and your own API keys, you maintain control over your data. Your source code stays on your machine, and only the necessary context is sent to the LLM provider for processing.

Getting Started with Deska

If you are ready to change how you build PHP applications, you can start by organizing your tools in a way that prioritizes clarity and speed. A spatial workspace provides the room you need to let AI agents work effectively without cluttering your main editor. You can download the free desktop app for Mac, Windows, or Linux to begin building your custom Laravel environment.