controller
Rapidly generates standardized CRUD controllers for the CatchAdmin framework.
Install
mkdir -p .claude/skills/controller && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/5020" && unzip -o skill.zip -d .claude/skills/controller && rm skill.zipInstalls to .claude/skills/controller
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Generate CRUD controller for CatchAdmin module.Key capabilities
- →Generate CRUD controller files
- →Implement pagination for list views
- →Handle data creation and updates
- →Support record deletion and status toggling
- →Provide data export functionality
- →Enable file-based data import
How it works
The skill generates a PHP controller class that extends CatchController, utilizing model methods like getList, storeBy, and updateBy to handle standard database operations.
Inputs & outputs
When to use controller
- →Creating new CRUD modules
- →Boilerplate generation for admin panels
- →Standardizing controller logic
About this skill
Step 4: Generate Controller
创建 CRUD 控制器。
File Location
modules/{Module}/Http/Controllers/{Model}Controller.php
Template
<?php
namespace Modules\{Module}\Http\Controllers;
use Catch\Base\CatchController as Controller;
use Illuminate\Http\Request;
use Modules\{Module}\Http\Requests\{Model}Request;
use Modules\{Module}\Models\{Model};
use Modules\{Module}\Import\{Model} as {Model}Import;
class {Model}Controller extends Controller
{
public function __construct(
protected readonly {Model} $model
) {}
/**
* List with pagination
*/
public function index()
{
return $this->model->getList();
}
/**
* Create
*/
public function store({Model}Request $request)
{
return $this->model->storeBy($request->all());
}
/**
* Show
*/
public function show($id): mixed
{
return $this->model->firstBy($id);
}
/**
* Update
*/
public function update($id, {Model}Request $request): mixed
{
return $this->model->updateBy($id, $request->all());
}
/**
* Delete
*/
public function destroy($id)
{
return $this->model->deleteBy($id);
}
/**
* Toggle status
*/
public function enable($id)
{
return $this->model->toggleBy($id);
}
/**
* Export
*/
public function export(): mixed
{
return {Model}::query()
->select('id', 'name', 'created_at')
->get()
->download(['ID', 'Name', 'Created At']);
}
/**
* Import
*/
public function import(Request $request, {Model}Import $import)
{
return $import->import($request->file('file'));
}
}
CatchController Methods
| Method | Purpose |
|---|---|
getList() | 分页列表 (使用 $searchable) |
storeBy() | 创建记录 (使用 $form) |
firstBy() | 获取单条 |
updateBy() | 更新记录 |
deleteBy() | 软删除 |
toggleBy() | 切换状态 |
When not to use it
- →Non-CatchAdmin module structures
- →Complex business logic outside CRUD
Prerequisites
Limitations
- →Requires specific CatchAdmin directory structure
How it compares
Unlike manual controller creation, this skill enforces CatchAdmin naming conventions and pre-configures standard CRUD methods.
Compared to similar skills
controller side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| controller (this skill) | 1 | 6mo | No flags | Beginner |
| pennant-development | 2 | 5mo | No flags | Intermediate |
| extending-shopper | 1 | 4mo | No flags | Intermediate |
| import | 1 | 6mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by JaguarJack
View all by JaguarJack →You might also like
pennant-development
laravel
Manages feature flags with Laravel Pennant. Activates when creating, checking, or toggling feature flags; showing or hiding features conditionally; implementing A/B testing; working with @feature directive; or when the user mentions feature flags, feature toggles, Pennant, conditional features, rollouts, or gradually enabling features.
extending-shopper
shopperlabs
Provides patterns for extending Laravel Shopper with custom sidebar items, component overrides, event listeners, and domain features like stock, pricing, and media. Use when customizing Shopper behavior.
import
JaguarJack
Generate Excel import class for CatchAdmin module.
laravel-backup
Scanix
Configure and extend spatie/laravel-backup for database and file backups, cleanup strategies, health monitoring, and notifications. Activates when working with backup configuration, scheduling backups, creating custom cleanup strategies or health checks, customizing notifications, or when the user m
filament-5-resources
kooda-ai
Use when: working with Filament 5 Resources, Resource classes, make:filament-resource, simple resources, form(), infolist(), table(), getPages(), resource pages, ViewRecord pages, page routes, ListRecords, CreateRecord, EditRecord, ViewRecord, relation managers, relation pages, getRelations(), getRe
laravel-pdf
spatie
Generate PDFs from Blade views or HTML using spatie/laravel-pdf. Covers creating, formatting, saving, downloading, and testing PDFs with the Browsershot, Cloudflare, or DOMPDF driver.