Modules / Routes

Design Laravel routes with context.

The Route module describes an HTTP or framework entry point, connects it to the rest of your workflow, and publishes its generated source to the correct Laravel route file.

What the Route module represents

A Route module is the workflow’s entry point for a request or route definition. Connect it to a controller, request, service, model, page or other module to show how the route moves through your application.

The connections become useful context for AI. When you generate code, AppyHP can see the selected route, its neighboring modules, their configuration, the workflow description, the project structure and the existing target source.

Choose the route file

Open a Route module and use the Route file dropdown at the top of the module editor. Choose the Laravel route group that should contain the route:

The selector controls the target filename. Route modules use the shared routes directory, and their filenames are managed by the selected route type so the module cannot accidentally drift away from its Laravel route file.

Describe what the route should do

Use the module prompt to explain the route’s responsibility in plain language. Include its HTTP method, URI, route name, middleware, controller action, connected modules, authorization expectations, parameters and response. For example:

Register a GET /accounts route named accounts.index. Use the connected AccountController@index action and the web middleware group. Return the connected Accounts/Index page.

The module description identifies its role in the workflow, while the prompt gives AI implementation instructions. A focused prompt makes generated code easier to review and keeps the workflow understandable to teammates.

Generate and publish route code

Select the Route module, review its configuration, and choose Generate. AppyHP keeps the generated code as a draft while you review it. The code is published to the selected route file when you click the main Save button.

When Auto-save is enabled, changes are published automatically after a short pause. If the target route file does not exist, AppyHP creates it as part of the save process. This applies to web.php, api.php, console.php and channels.php.

Changing the Route file selection switches the module to the standard file for that route type. AppyHP writes the generated route definition to the selected file without renaming another Laravel route file.

Shared route files

Every Route module using the same type points to the same standard Laravel file. For example, all modules set to api target routes/api.php; they do not create separate files such as api-2.php.

Use the workflow graph and each module’s prompt to keep related route definitions coordinated. The complete target file can also be inspected and edited in the Directories panel.

Review the real file

Open the Directories panel and browse to routes. Select the route file to inspect the source that is actually stored in the Laravel project.

A practical workflow

  1. Add a Route module to the workflow.
  2. Select web, api, console or channels.
  3. Describe the method, URI, middleware, route name and controller action in the module prompt.
  4. Connect the route to the Controller and any related modules.
  5. Describe the intended behavior in the prompt.
  6. Generate the code and review the draft.
  7. Click Save, or enable Auto-save, to create or update the shared Laravel route file.
  8. Open the file in Directories to review the published source and add notes.

← Return to workflows