api-controller

Generate Laravel API controllers with RESTful actions, validation, and resources.

Updated Jul 18, 2022
One-click install
npx skills add https://github.com/milosptr/pos-system --skill api-controller-milosptr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-controller
Source: https://github.com/milosptr/pos-system/tree/main/.claude/skills/api-controller
Command: npx skills add https://github.com/milosptr/pos-system --skill api-controller-milosptr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generate a Laravel API controller that adheres to the project's established patterns.

Core Features & Use Cases

  • Automates creation of standard RESTful actions: index, show, store, update, destroy.
  • Integrates request validation, resources, and route hints to speed up API development.
  • Useful for adding new resources to public APIs or backoffice sections with consistent structure.

Quick Start

Create a new Laravel API controller for a given resource following the project's conventions.

Frequently Asked Questions about api-controller

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a Laravel API controller with standard RESTful actions?

To generate a Laravel API controller, you can automate the creation of standard RESTful actions like index, show, store, update, and destroy while adhering to your project's established patterns. This ensures consistent structure and coding standards across your API resources.

What is the best way to add request validation and resources to a Laravel API controller?

The best way to integrate request validation and resources into a Laravel API controller is by automating their inclusion during the controller generation process. This enforces coding standards and speeds up API development by handling common actions and route hints.

Can I use this to generate controllers for both public and backoffice API sections?

Yes, you can use this to generate controllers for both public and backoffice API sections. It includes route guidance for public and backoffice contexts, ensuring a consistent controller structure across different areas of your application.

How does this approach enforce coding standards when creating new Laravel resources?

This approach enforces coding standards by utilizing your project's existing controller structure to generate new API controllers. It adheres to established patterns, ensuring that all automated actions and route hints maintain consistency across the codebase.

Why should I automate Laravel controller generation instead of writing boilerplate manually?

Automating Laravel controller generation eliminates manual boilerplate, speeds up API development, and reduces human error. It automatically integrates request validation, resources, and route hints while enforcing consistent project patterns across all new API endpoints.