itsmejay18/ai-skills-for-my-development-stack/routing-and-controllers
Claude Code and agent skill by itsmejay18/ai-skills-for-my-development-stack
- community
Checking that the SKILL.md file is still in the repository.
Creating controllers, registering routes, and understanding how routes map to Wayfinder TypeScript actions.
Install
npx vskill@latest install itsmejay18/ai-skills-for-my-development-stack/routing-and-controllersSKILL.md
The same SKILL.md was published earlier as itsmejay18/ai-skills-for-my-development-stack/routing-and-controllers.
Routing and Controllers
When to Activate This Skill
Activate this skill whenever:
- Creating new controllers or modifying existing ones
- Registering routes in
routes/web.phpor other route files - Working with RESTful resource routing
- Understanding how routes map to Wayfinder TypeScript actions
- Troubleshooting missing controller actions or route registration issues
The Complete Workflow
When creating a new controller with a route:
- Create the controller using Artisan:
``bash php artisan make:controller JobController --no-interaction ``
- Implement the controller action with proper type hints and return types:
``php final class JobController { public function show(int $id): string { return "Job details for job {$id}"; } } ``
- Register the route in
routes/web.php:
```php use App\Http\Controllers\JobController;
Route::middleware(['auth', 'verified'])->group(function () { Route::resource('jobs', JobController::class) ->only(['show']); }); ```
- Generate Wayfinder TypeScript actions:
``bash php artisan wayfinder:generate --no-interaction ``
- Use the generated action in React components:
```typescript import JobController from '@/actions/App/Http/Controllers/JobController';
<Link href={JobController.show(jobId).url}>View Job</Link> ```
RESTful Resource Routing
This project uses Laravel's resource routing convention:
Common patterns:
.only(['index', 'show'])— Read-only resources.only(['show'])— Single action (like job details).only(['store', 'update', 'destroy'])— Mutation actions
Critical: Routes Must Be Registered for Wayfinder
Wayfinder only generates TypeScript action files for routes that are actually registered in your route files.
If you create a controller but don't register its route, Wayfinder won't generate the TypeScript action file, and you'll get import errors in your React components.
Troubleshooting Missing Action Files
If import JobController from '@/actions/...' fails:
- Check that the route is registered in
routes/web.php - Verify the controller class name matches the import path
- Run
php artisan wayfinder:generate --no-interactionagain - Check that the generated file exists in
resources/js/actions/
If still missing, activate the troubleshooting skill for further diagnosis.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking01-Laravel-Web-Development/routing-and-controllers/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/itsmejay18/ai-skills-for-my-development-stack/routing-and-controllers)