smithery/jaguarjack

controller

Generate CRUD controller for CatchAdmin module.

Installation

$ npx skills add smithery/jaguarjack --skill controller

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/jaguarjack.

npx skills add smithery/jaguarjack

Browse all from smithery/jaguarjack

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,156 B
  • docs SUMMARY.md 65 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

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() 切换状态